From f85b666de3d6de93f6c60d612e1c4abf5c671a90 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 30 Sep 2016 09:29:39 +0000 Subject: Add a few "const" keywords, just for 'correctness' --- unix/tkUnixFont.c | 6 +++--- unix/tkUnixRFont.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index 1b0f175..e694573 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -171,7 +171,7 @@ static Tcl_ThreadDataKey dataKey; * encodings into the names expected by the Tcl encoding package. */ -static EncodingAlias encodingAliases[] = { +static const EncodingAlias encodingAliases[] = { {"gb2312-raw", "gb2312*"}, {"big5", "big5*"}, {"cns11643-1", "cns11643*-1"}, @@ -408,8 +408,8 @@ ControlUtfProc( char *dstStart, *dstEnd; int ch; int result; - static char hexChars[] = "0123456789abcdef"; - static char mapChars[] = { + static const char hexChars[] = "0123456789abcdef"; + static const char mapChars[] = { 0, 0, 0, 0, 0, 0, 0, 'a', 'b', 't', 'n', 'v', 'f', 'r' }; diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index cf4127d..36c4540 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -69,7 +69,7 @@ void TkpFontPkgInit( TkMainInfo *mainPtr) /* The application being created. */ { - static Tcl_Config cfg[] = { + static const Tcl_Config cfg[] = { { "fontsystem", "xft" }, { 0,0 } }; -- cgit v0.12 From dbd5092cb00d45365d9260c2c767757fa4219ede Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 2 Nov 2016 20:07:14 +0000 Subject: Removed proc ::tk_getFileType since it is used nowhere in Tk, is undocumented, is superseded by the -typevariable option of file dialogs, and was anyway only available if tk_strictMotif is true. --- library/tclIndex | 1 - library/xmfbox.tcl | 7 ------- 2 files changed, 8 deletions(-) diff --git a/library/tclIndex b/library/tclIndex index b3f37fa..919fa8a 100644 --- a/library/tclIndex +++ b/library/tclIndex @@ -247,7 +247,6 @@ set auto_index(::tk::ListBoxKeyAccel_Unset) [list source [file join $dir xmfbox. set auto_index(::tk::ListBoxKeyAccel_Key) [list source [file join $dir xmfbox.tcl]] set auto_index(::tk::ListBoxKeyAccel_Goto) [list source [file join $dir xmfbox.tcl]] set auto_index(::tk::ListBoxKeyAccel_Reset) [list source [file join $dir xmfbox.tcl]] -set auto_index(tk_getFileType) [list source [file join $dir xmfbox.tcl]] set auto_index(::tk::unsupported::ExposePrivateCommand) [list source [file join $dir unsupported.tcl]] set auto_index(::tk::unsupported::ExposePrivateVariable) [list source [file join $dir unsupported.tcl]] set auto_index(::tk::fontchooser) [list source [file join $dir fontchooser.tcl]] diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl index 14d2be5..f1daea0 100644 --- a/library/xmfbox.tcl +++ b/library/xmfbox.tcl @@ -210,7 +210,6 @@ proc ::tk::MotifFDialog_SetFilter {w type} { variable ::tk::Priv set data(filter) [lindex $type 1] - set Priv(selectFileType) [lindex [lindex $type 0] 0] MotifFDialog_Update $w } @@ -981,9 +980,3 @@ proc ::tk::ListBoxKeyAccel_Reset {w} { unset -nocomplain Priv(lbAccel,$w) } -proc ::tk_getFileType {} { - variable ::tk::Priv - - return $Priv(selectFileType) -} - -- cgit v0.12 From 2da9e225ec7604a5ad4e4dc46e76d090d733b87c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Nov 2016 15:38:45 +0000 Subject: More internal use of size_t, so refcounts can be bigger than before (2^31 -> 2^32 on 32-bit platforms, even more on 64-bit) --- generic/tkConfig.c | 21 ++++++++++----------- generic/tkConsole.c | 12 ++++++------ generic/tkFont.c | 5 ++--- unix/tkUnixFont.c | 15 +++++++-------- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 9c159e6..093bd35 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -91,7 +91,7 @@ typedef struct TkOption { */ typedef struct OptionTable { - int refCount; /* Counts the number of uses of this table + size_t refCount; /* Counts the number of uses of this table * (the number of times Tk_CreateOptionTable * has returned it). This can be greater than * 1 if it is shared along several option @@ -103,7 +103,7 @@ typedef struct OptionTable { * templates, this points to the table * corresponding to the next template in the * chain. */ - int numOptions; /* The number of items in the options array + size_t numOptions; /* The number of items in the options array * below. */ Option options[1]; /* Information about the individual options in * the table. This must be the last field in @@ -177,7 +177,7 @@ Tk_CreateOptionTable( OptionTable *tablePtr; const Tk_OptionSpec *specPtr, *specPtr2; Option *optionPtr; - int numOptions, i; + size_t numOptions, i; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -330,10 +330,9 @@ Tk_DeleteOptionTable( { OptionTable *tablePtr = (OptionTable *) optionTable; Option *optionPtr; - int count; + size_t count; - tablePtr->refCount--; - if (tablePtr->refCount > 0) { + if (tablePtr->refCount-- > 1) { return; } @@ -978,7 +977,7 @@ GetOption( Option *bestPtr, *optionPtr; OptionTable *tablePtr2; const char *p1, *p2; - int count; + size_t count; /* * Search through all of the option tables in the chain to find the best @@ -1539,7 +1538,7 @@ Tk_FreeConfigOptions( { OptionTable *tablePtr; Option *optionPtr; - int count; + size_t count; Tcl_Obj **oldPtrPtr, *oldPtr; char *oldInternalPtr; const Tk_OptionSpec *specPtr; @@ -1733,7 +1732,7 @@ Tk_GetOptionInfo( Tcl_Obj *resultPtr; OptionTable *tablePtr = (OptionTable *) optionTable; Option *optionPtr; - int count; + size_t count; /* * If information is only wanted for a single configuration spec, then @@ -2096,9 +2095,9 @@ TkDebugConfig( if (tablePtr == (OptionTable *) Tcl_GetHashValue(hashEntryPtr)) { for ( ; tablePtr != NULL; tablePtr = tablePtr->nextPtr) { Tcl_ListObjAppendElement(NULL, objPtr, - Tcl_NewIntObj(tablePtr->refCount)); + Tcl_NewWideIntObj(tablePtr->refCount)); Tcl_ListObjAppendElement(NULL, objPtr, - Tcl_NewIntObj(tablePtr->numOptions)); + Tcl_NewWideIntObj(tablePtr->numOptions)); Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewStringObj( tablePtr->options[0].specPtr->optionName, -1)); } diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 8bfbe9b..fc60d5f 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -24,7 +24,7 @@ typedef struct ConsoleInfo { Tcl_Interp *consoleInterp; /* Interpreter displaying the console. */ Tcl_Interp *interp; /* Interpreter controlled by console. */ - int refCount; + size_t refCount; } ConsoleInfo; /* @@ -452,7 +452,7 @@ Tk_CreateConsoleWindow( if (mainWindow) { Tk_DeleteEventHandler(mainWindow, StructureNotifyMask, ConsoleEventProc, info); - if (--info->refCount <= 0) { + if (info->refCount-- <= 1) { ckfree(info); } } @@ -592,7 +592,7 @@ ConsoleClose( ConsoleInfo *info = data->info; if (info) { - if (--info->refCount <= 0) { + if (info->refCount-- <= 1) { /* * Assuming the Tcl_Interp * fields must already be NULL. */ @@ -881,7 +881,7 @@ InterpDeleteProc( Tcl_DeleteThreadExitHandler(DeleteConsoleInterp, info->consoleInterp); info->consoleInterp = NULL; } - if (--info->refCount <= 0) { + if (info->refCount-- <= 1) { ckfree(info); } } @@ -912,7 +912,7 @@ ConsoleDeleteProc( if (info->consoleInterp) { Tcl_DeleteInterp(info->consoleInterp); } - if (--info->refCount <= 0) { + if (info->refCount-- <= 1) { ckfree(info); } } @@ -949,7 +949,7 @@ ConsoleEventProc( Tcl_EvalEx(consoleInterp, "tk::ConsoleExit", -1, TCL_EVAL_GLOBAL); } - if (--info->refCount <= 0) { + if (info->refCount-- <= 1) { ckfree(info); } } diff --git a/generic/tkFont.c b/generic/tkFont.c index 7f2715b..a00c627 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -41,7 +41,7 @@ typedef struct TkFontInfo { */ typedef struct NamedFont { - int refCount; /* Number of users of named font. */ + size_t refCount; /* Number of users of named font. */ int deletePending; /* Non-zero if font should be deleted when * last reference goes away. */ TkFontAttributes fa; /* Desired attributes for named font. */ @@ -1434,8 +1434,7 @@ Tk_FreeFont( */ nfPtr = Tcl_GetHashValue(fontPtr->namedHashPtr); - nfPtr->refCount--; - if ((nfPtr->refCount == 0) && nfPtr->deletePending) { + if ((nfPtr->refCount-- <= 1) && nfPtr->deletePending) { Tcl_DeleteHashEntry(fontPtr->namedHashPtr); ckfree(nfPtr); } diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index e694573..c96e562 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -19,8 +19,8 @@ * The preferred font encodings. */ -static const char *const encodingList[] = { - "iso8859-1", "jis0208", "jis0212", NULL +static const char encodingList[][10] = { + "iso8859-1", "jis0208", "jis0212" }; /* @@ -42,7 +42,7 @@ static const char *const encodingList[] = { typedef struct FontFamily { struct FontFamily *nextPtr; /* Next in list of all known font families. */ - int refCount; /* How many SubFonts are referring to this + size_t refCount; /* How many SubFonts are referring to this * FontFamily. When the refCount drops to * zero, this FontFamily may be freed. */ /* @@ -1916,8 +1916,7 @@ FreeFontFamily( if (familyPtr == NULL) { return; } - familyPtr->refCount--; - if (familyPtr->refCount > 0) { + if (familyPtr->refCount-- > 1) { return; } Tcl_FreeEncoding(familyPtr->encoding); @@ -2686,7 +2685,7 @@ RankAttributes( penalty += 150 * diff; } if (gotPtr->xa.charset != wantPtr->xa.charset) { - int i; + size_t i; const char *gotAlias, *wantAlias; penalty += 65000; @@ -2694,7 +2693,7 @@ RankAttributes( wantAlias = GetEncodingAlias(wantPtr->xa.charset); if (strcmp(gotAlias, wantAlias) != 0) { penalty += 30000; - for (i = 0; encodingList[i] != NULL; i++) { + for (i = 0; i < sizeof(encodingList)/sizeof(encodingList[0]); i++) { if (strcmp(gotAlias, encodingList[i]) == 0) { penalty -= 30000; break; @@ -3012,7 +3011,7 @@ static const char * GetEncodingAlias( const char *name) /* The name to look up. */ { - EncodingAlias *aliasPtr; + const EncodingAlias *aliasPtr; for (aliasPtr = encodingAliases; aliasPtr->aliasPattern != NULL; ) { if (Tcl_StringMatch(name, aliasPtr->aliasPattern)) { -- cgit v0.12 From 3b8a1a19064c05bb314d93d5ce9e2d51efbb5e44 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 9 Nov 2016 13:41:27 +0000 Subject: Bring all win32 version stuff to one place. Should work the same (should still work on XP, although I don't know if we really want that). --- win/tkWin.h | 12 +++++++++--- win/tkWinMenu.c | 17 ++++++----------- win/tkWinX.c | 10 ---------- win/ttkWinXPTheme.c | 6 +----- 4 files changed, 16 insertions(+), 29 deletions(-) diff --git a/win/tkWin.h b/win/tkWin.h index 4d278d7..86be2e9 100644 --- a/win/tkWin.h +++ b/win/tkWin.h @@ -18,14 +18,20 @@ * the SystemParametersInfo API doesn't like to receive structures that * are larger than it expects which affects the font assignments. * - * WINVER = 0x0500 means Windows 2000 and above + * NTDDI_VERSION = 0x0600 means Windows Vista and above */ +#ifndef NTDDI_VERSION +#define NTDDI_VERSION 0x06000000 +#endif #ifndef WINVER -#define WINVER 0x0500 +#define WINVER 0x0600 #endif #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0600 +#endif +#ifndef _WIN32_IE +#define _WIN32_IE 0x0600 #endif #ifndef _TK diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 8e14669..0975633 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -3203,12 +3203,7 @@ SetDefaults( int pointSize; HFONT menuFont; /* See: [Bug #3239768] tk8.4.19 (and later) WIN32 menu font support */ - struct { - NONCLIENTMETRICS metrics; -#if (WINVER < 0x0600) - int padding; -#endif - } nc; + NONCLIENTMETRICS metrics; OSVERSIONINFOW os; /* @@ -3227,17 +3222,17 @@ SetDefaults( } Tcl_DStringInit(&menuFontDString); - nc.metrics.cbSize = sizeof(nc); + metrics.cbSize = sizeof(metrics); os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&os); if (os.dwMajorVersion < 6) { - nc.metrics.cbSize -= sizeof(int); + metrics.cbSize -= sizeof(int); } - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, nc.metrics.cbSize, - &nc.metrics, 0); - menuFont = CreateFontIndirect(&nc.metrics.lfMenuFont); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, + &metrics, 0); + menuFont = CreateFontIndirect(&metrics.lfMenuFont); SelectObject(scratchDC, menuFont); GetTextMetricsA(scratchDC, &tm); GetTextFaceA(scratchDC, LF_FACESIZE, faceName); diff --git a/win/tkWinX.c b/win/tkWinX.c index cfd64af..d41b6c1 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -13,16 +13,6 @@ #include "tkWinInt.h" -/* - * The w32api 1.1 package (included in Mingw 1.1) does not define _WIN32_IE by - * default. Define it here to gain access to the InitCommonControlsEx API in - * commctrl.h. - */ - -#ifndef _WIN32_IE -#define _WIN32_IE 0x0550 /* IE 5.5 */ -#endif - #include #ifdef _MSC_VER # pragma comment (lib, "comctl32.lib") diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 3de1504..909660a 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -15,14 +15,12 @@ * shellcc/platform/commctls/userex/refentry.asp > */ +#include #ifndef HAVE_UXTHEME_H /* Stub for platforms that lack the XP theme API headers: */ -#include int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { return TCL_OK; } #else -#define WINVER 0x0501 /* Requires Windows XP APIs */ - #include #include #if defined(HAVE_VSSYM32_H) || _MSC_VER > 1500 @@ -31,8 +29,6 @@ int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { return TCL_OK; } # include #endif -#include - #include "ttk/ttkTheme.h" typedef HTHEME (STDAPICALLTYPE OpenThemeDataProc)(HWND hwnd, -- cgit v0.12 From 39cfdaa0524f329527d9ee22d9229ce476560f05 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 30 Nov 2016 21:51:25 +0000 Subject: Fixed [3ee76e41c2] - New textTag test failures --- tests/textTag.test | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/tests/textTag.test b/tests/textTag.test index 2df8c5a..a2b2d73 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -11,6 +11,19 @@ namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands +set textWidgetFont {Courier 12} +set bigFont {Helvetica 24} + +# what is needed is a specific font *size* because in some tests (that +# will be constrained by haveFontSizes), a tag applying the $bigFont +# will be set to some characters, which action has the effect of +# changing what character is under the mouse pointer, which is the +# purpose of the tests +testConstraint haveFontSizes [expr { + [font actual $textWidgetFont -size] == 12 && + [font actual $bigFont -size] == 24 } +] + destroy .t text .t -width 20 -height 10 @@ -19,7 +32,6 @@ update .t debug on wm geometry . {} -set bigFont {Helvetica 24} # The statements below reset the main window; it's needed if the window # manager is mwm, to make mwm forget about a previous minimum size setting. @@ -1313,9 +1325,13 @@ test textTag-16.1 {TkTextPickCurrent procedure} -setup { lappend x [.t index current] } -result {2.1 3.2 3.2 3.2 3.2 3.2 4.3} -test textTag-16.2 {TkTextPickCurrent procedure} -setup { +test textTag-16.2 {TkTextPickCurrent procedure} -constraints { + haveFontSizes +} -setup { .t tag delete {*}[.t tag names] event generate {} -warp 1 -x -1 -y -1; update + set curFont [.t cget -font] + .t configure -font $textWidgetFont } -body { .t tag configure big -font $bigFont event gen .t -state 0x100 -x $x1 -y $y1 @@ -1326,6 +1342,7 @@ test textTag-16.2 {TkTextPickCurrent procedure} -setup { lappend x [.t index current] } -cleanup { .t tag delete big + .t configure -font $curFont } -result {3.2 3.1} test textTag-16.3 {TkTextPickCurrent procedure} -setup { @@ -1381,11 +1398,15 @@ test textTag-16.4 {TkTextPickCurrent procedure} -setup { .t tag delete {*}[.t tag names] } -result {enter-a enter-b enter-c | leave-c leave-b} -test textTag-16.5 {TkTextPickCurrent procedure} -setup { +test textTag-16.5 {TkTextPickCurrent procedure} -constraints { + haveFontSizes +} -setup { foreach i {big a b c d} { .t tag remove $i 1.0 end } event generate {} -warp 1 -x -1 -y -1; update + set curFont [.t cget -font] + .t configure -font $textWidgetFont } -body { .t tag configure big -font $bigFont event gen .t -x $x1 -y $y1 @@ -1395,13 +1416,18 @@ test textTag-16.5 {TkTextPickCurrent procedure} -setup { .t index current } -cleanup { .t tag delete a big + .t configure -font $curFont } -result {3.2} -test textTag-16.6 {TkTextPickCurrent procedure} -setup { +test textTag-16.6 {TkTextPickCurrent procedure} -constraints { + haveFontSizes +} -setup { foreach i {big a b c d} { .t tag remove $i 1.0 end } event generate {} -warp 1 -x -1 -y -1; update + set curFont [.t cget -font] + .t configure -font $textWidgetFont } -body { .t tag configure big -font $bigFont event gen .t -x $x1 -y $y1 @@ -1412,13 +1438,18 @@ test textTag-16.6 {TkTextPickCurrent procedure} -setup { .t index current } -cleanup { .t tag delete a big + .t configure -font $curFont } -result {3.1} -test textTag-16.7 {TkTextPickCurrent procedure} -setup { +test textTag-16.7 {TkTextPickCurrent procedure} -constraints { + haveFontSizes +} -setup { foreach i {big a b c d} { .t tag remove $i 1.0 end } event generate {} -warp 1 -x -1 -y -1; update + set curFont [.t cget -font] + .t configure -font $textWidgetFont } -body { .t tag configure big -font $bigFont .t tag bind a {.t tag add big 3.0 3.2} @@ -1432,6 +1463,7 @@ test textTag-16.7 {TkTextPickCurrent procedure} -setup { .t index current } -cleanup { .t tag delete a big + .t configure -font $curFont } -result {3.1} -- cgit v0.12 From 9d9cee0288f4ef2d88ddaa3a3f41c34751d851fd Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 1 Dec 2016 19:27:08 +0000 Subject: Also the fact that the actually used fonts must be fixed-width needs to be checked when assessing the value of the haveFontSizes constraint --- tests/textTag.test | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/textTag.test b/tests/textTag.test index a2b2d73..6489c3a 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -12,16 +12,18 @@ eval tcltest::configure $argv tcltest::loadTestedCommands set textWidgetFont {Courier 12} -set bigFont {Helvetica 24} +set bigFont {Courier 24} -# what is needed is a specific font *size* because in some tests (that -# will be constrained by haveFontSizes), a tag applying the $bigFont -# will be set to some characters, which action has the effect of -# changing what character is under the mouse pointer, which is the -# purpose of the tests +# what is needed is a font that is both fixed-width and featuring a +# specific size because in some tests (that will be constrained by +# haveFontSizes), a tag applying the $bigFont will be set to some +# characters, which action has the effect of changing what character +# is under the mouse pointer, which is the purpose of the tests testConstraint haveFontSizes [expr { - [font actual $textWidgetFont -size] == 12 && - [font actual $bigFont -size] == 24 } + [font metrics $textWidgetFont -fixed] && + [font actual $textWidgetFont -size] == 12 && + [font metrics $bigFont -fixed] && + [font actual $bigFont -size] == 24 } ] destroy .t -- cgit v0.12 From cabe11c363724790cf77f9a1c39b27703d0093b9 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 1 Dec 2016 21:45:34 +0000 Subject: When changing the text font, (x,y) coordinates previously saved in the (xi,yi) doublets are no longer relevant. Save coordinates for each of the two font possibilities, and use the right ones in each test. --- tests/textTag.test | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/tests/textTag.test b/tests/textTag.test index 6489c3a..ca34bc7 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -1210,7 +1210,8 @@ test textTag-14.4 {SortTags} -setup { } -result {x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29} - +set curFont [.t cget -font] +set curWrap [.t cget -wrap] set c [.t bbox 2.1] set x1 [expr [lindex $c 0] + [lindex $c 2]/2] set y1 [expr [lindex $c 1] + [lindex $c 3]/2] @@ -1220,6 +1221,15 @@ set y2 [expr [lindex $c 1] + [lindex $c 3]/2] set c [.t bbox 4.3] set x3 [expr [lindex $c 0] + [lindex $c 2]/2] set y3 [expr [lindex $c 1] + [lindex $c 3]/2] +.t configure -font $textWidgetFont -wrap none +update +set c [.t bbox 2.1] +set x4 [expr [lindex $c 0] + [lindex $c 2]/2] +set y4 [expr [lindex $c 1] + [lindex $c 3]/2] +set c [.t bbox 3.2] +set x5 [expr [lindex $c 0] + [lindex $c 2]/2] +set y5 [expr [lindex $c 1] + [lindex $c 3]/2] +.t configure -font $curFont -wrap $curWrap test textTag-15.1 {TkTextBindProc} -setup { .t tag delete x y @@ -1333,18 +1343,18 @@ test textTag-16.2 {TkTextPickCurrent procedure} -constraints { .t tag delete {*}[.t tag names] event generate {} -warp 1 -x -1 -y -1; update set curFont [.t cget -font] - .t configure -font $textWidgetFont + .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont - event gen .t -state 0x100 -x $x1 -y $y1 - event gen .t -x $x2 -y $y2 + event gen .t -state 0x100 -x $x4 -y $y4 + event gen .t -x $x5 -y $y5 set x [.t index current] .t tag add big 3.0 update lappend x [.t index current] } -cleanup { .t tag delete big - .t configure -font $curFont + .t configure -font $curFont -wrap $curWrap } -result {3.2 3.1} test textTag-16.3 {TkTextPickCurrent procedure} -setup { @@ -1408,17 +1418,17 @@ test textTag-16.5 {TkTextPickCurrent procedure} -constraints { } event generate {} -warp 1 -x -1 -y -1; update set curFont [.t cget -font] - .t configure -font $textWidgetFont + .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont - event gen .t -x $x1 -y $y1 + event gen .t -x $x4 -y $y4 .t tag bind a {.t tag add big 3.0 3.2} .t tag add a 3.2 - event gen .t -x $x2 -y $y2 + event gen .t -x $x5 -y $y5 .t index current } -cleanup { .t tag delete a big - .t configure -font $curFont + .t configure -font $curFont -wrap $curWrap } -result {3.2} test textTag-16.6 {TkTextPickCurrent procedure} -constraints { @@ -1429,18 +1439,18 @@ test textTag-16.6 {TkTextPickCurrent procedure} -constraints { } event generate {} -warp 1 -x -1 -y -1; update set curFont [.t cget -font] - .t configure -font $textWidgetFont + .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont - event gen .t -x $x1 -y $y1 + event gen .t -x $x4 -y $y4 .t tag bind a {.t tag add big 3.0 3.2} .t tag add a 3.2 - event gen .t -x $x2 -y $y2 + event gen .t -x $x5 -y $y5 update .t index current } -cleanup { .t tag delete a big - .t configure -font $curFont + .t configure -font $curFont -wrap $curWrap } -result {3.1} test textTag-16.7 {TkTextPickCurrent procedure} -constraints { @@ -1451,21 +1461,21 @@ test textTag-16.7 {TkTextPickCurrent procedure} -constraints { } event generate {} -warp 1 -x -1 -y -1; update set curFont [.t cget -font] - .t configure -font $textWidgetFont + .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont .t tag bind a {.t tag add big 3.0 3.2} .t tag add a 3.2 - event gen .t -x $x1 -y $y1 + event gen .t -x $x4 -y $y4 .t tag bind a {.t tag add big 3.0 3.2} .t tag add a 2.1 - event gen .t -x $x2 -y $y2 + event gen .t -x $x5 -y $y5 update .t index current } -cleanup { .t tag delete a big - .t configure -font $curFont + .t configure -font $curFont -wrap $curWrap } -result {3.1} -- cgit v0.12 From 954d42e47de744904aac4b8d78c7f7b4048e8a17 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 2 Dec 2016 06:35:22 +0000 Subject: Remove superfluous lines (the default font of the text widget is already saved in $curFont before the tests start). --- tests/textTag.test | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/textTag.test b/tests/textTag.test index ca34bc7..93feb27 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -1342,7 +1342,6 @@ test textTag-16.2 {TkTextPickCurrent procedure} -constraints { } -setup { .t tag delete {*}[.t tag names] event generate {} -warp 1 -x -1 -y -1; update - set curFont [.t cget -font] .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont @@ -1417,7 +1416,6 @@ test textTag-16.5 {TkTextPickCurrent procedure} -constraints { .t tag remove $i 1.0 end } event generate {} -warp 1 -x -1 -y -1; update - set curFont [.t cget -font] .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont @@ -1438,7 +1436,6 @@ test textTag-16.6 {TkTextPickCurrent procedure} -constraints { .t tag remove $i 1.0 end } event generate {} -warp 1 -x -1 -y -1; update - set curFont [.t cget -font] .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont @@ -1460,7 +1457,6 @@ test textTag-16.7 {TkTextPickCurrent procedure} -constraints { .t tag remove $i 1.0 end } event generate {} -warp 1 -x -1 -y -1; update - set curFont [.t cget -font] .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont -- cgit v0.12 From fd7ab722c98be2bee1064d8721bbcae710a74f14 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 2 Dec 2016 12:57:58 +0000 Subject: [76e2d9c095] Repair broken test border-3.1 --- tests/border.test | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/border.test b/tests/border.test index 2ca64c1..d6ff5c7 100644 --- a/tests/border.test +++ b/tests/border.test @@ -127,16 +127,18 @@ test border-2.2 {Tk_Free3DBorder - unlinking from list} -constraints { destroy .b .t2 .t3 .t } -result {{{4 1} {3 0} {2 0} {1 0}} {{4 1} {2 0} {1 0}} {{4 1} {2 0}} {{2 0}} {}} + test border-3.1 {FreeBorderObjProc} -constraints { testborder } -setup { set result {} + proc copy {s} {return [string index $s 0][string range $s 1 end]} } -body { - set x [join purple] + set x [copy purple] button .b -bg $x -text .b1 - set y [join purple] + set y [copy purple] .b configure -bg $y - set z [join purple] + set z [copy purple] .b configure -bg $z lappend result [testborder purple] set x red @@ -148,6 +150,7 @@ test border-3.1 {FreeBorderObjProc} -constraints { set y bogus return $result } -cleanup { + rename copy {} destroy .b } -result {{{1 3}} {{1 2}} {{1 1}} {}} -- cgit v0.12 From c9609fa27feeb754fbbaa92539825a04d2c4d7f6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 2 Dec 2016 20:58:36 +0000 Subject: Fix [ad98f10b3a] and [bd0017bf79] - bitmap-4.1 and cursor-4.1 tests failures. Also, apply again the same pattern to fix color-4.1 that was also failing (when the colorsFree constraint was met) despite there was no such report (yet). Thanks to dgp. --- tests/bitmap.test | 9 ++++++--- tests/color.test | 16 +++++++++++----- tests/cursor.test | 9 ++++++--- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/tests/bitmap.test b/tests/bitmap.test index bd9c47f..6996f88 100644 --- a/tests/bitmap.test +++ b/tests/bitmap.test @@ -84,12 +84,14 @@ test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} -constraints { test bitmap-4.1 {FreeBitmapObjProc} -constraints { testbitmap +} -setup { + proc copy {s} {return [string index $s 0][string range $s 1 end]} } -body { - set x [join questhead] + set x [copy questhead] button .b -bitmap $x - set y [join questhead] + set y [copy questhead] .b configure -bitmap $y - set z [join questhead] + set z [copy questhead] .b configure -bitmap $z set result {} lappend result [testbitmap questhead] @@ -102,6 +104,7 @@ test bitmap-4.1 {FreeBitmapObjProc} -constraints { set y bogus return $result } -cleanup { + rename copy {} destroy .b } -result {{{1 3}} {{1 2}} {{1 1}} {}} diff --git a/tests/color.test b/tests/color.test index 237ec01..0b328cf 100644 --- a/tests/color.test +++ b/tests/color.test @@ -255,13 +255,17 @@ test color-3.4 {Tk_FreeColorFromObj - unlinking from list} colorsFree { lappend result [testcolor purple] } {{{4 1} {3 0} {2 0} {1 0}} {{4 1} {2 0} {1 0}} {{4 1} {2 0}} {{2 0}} {}} -test color-4.1 {FreeColorObjProc} colorsFree { +test color-4.1 {FreeColorObjProc} -constraints { + colorsFree +} -setup { + proc copy {s} {return [string index $s 0][string range $s 1 end]} +} -body { destroy .b - set x [format purple] + set x [copy purple] button .b -foreground $x -text .b1 - set y [format purple] + set y [copy purple] .b configure -foreground $y - set z [format purple] + set z [copy purple] .b configure -foreground $z set result {} lappend result [testcolor purple] @@ -273,7 +277,9 @@ test color-4.1 {FreeColorObjProc} colorsFree { lappend result [testcolor purple] set y bogus set result -} {{{1 3}} {{1 2}} {{1 1}} {}} +} -cleanup { + rename copy {} +} -result {{{1 3}} {{1 2}} {{1 1}} {}} destroy .t diff --git a/tests/cursor.test b/tests/cursor.test index 95c7b99..8d7ebb0 100644 --- a/tests/cursor.test +++ b/tests/cursor.test @@ -144,12 +144,14 @@ test cursor-3.1 {Tk_FreeCursorFromObj - reference counts} -constraints { test cursor-4.1 {FreeCursorObjProc} -constraints { testcursor +} -setup { + proc copy {s} {return [string index $s 0][string range $s 1 end]} } -body { - set x [join heart] + set x [copy heart] button .b -cursor $x - set y [join heart] + set y [copy heart] .b configure -cursor $y - set z [join heart] + set z [copy heart] .b configure -cursor $z set result {} lappend result [testcursor heart] @@ -162,6 +164,7 @@ test cursor-4.1 {FreeCursorObjProc} -constraints { set y bogus set result } -cleanup { + rename copy {} destroy .b } -result {{{1 3}} {{1 2}} {{1 1}} {}} -- cgit v0.12 From e63cc287cacc144a9a0a5c405d49cca44b37e574 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 8 Dec 2016 20:46:48 +0000 Subject: Micro-optimization in tkTextDisp.c --- generic/tkTextDisp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index a6e665a..1c4925d 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -8981,13 +8981,13 @@ RemoveFromBaseChunk( bciPtr = baseCharChunkPtr->clientData; +#ifdef DEBUG_LAYOUT_WITH_BASE_CHUNKS if ((ciPtr->baseOffset + ciPtr->numBytes) != Tcl_DStringLength(&bciPtr->baseChars)) { -#ifdef DEBUG_LAYOUT_WITH_BASE_CHUNKS fprintf(stderr,"RemoveFromBaseChunk called with wrong chunk " "(not last)\n"); -#endif } +#endif Tcl_DStringSetLength(&bciPtr->baseChars, ciPtr->baseOffset); -- cgit v0.12 From 6130ca3ef131a8459a378ee9e3fa67484d6fe178 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 15 Dec 2016 16:07:06 +0000 Subject: Proposed fix for [7d967c68a09e07e355358af40f36dd5dd84c7022|7d967c68]: Tk applications segmentation fault when ibus-daemon IME is restarted --- generic/tkEvent.c | 13 ++++++++++++- generic/tkInt.h | 6 ++++++ generic/tkWindow.c | 11 +++++++++-- unix/tkUnixEvent.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 95aeda1..d058e7c 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -356,6 +356,7 @@ CreateXIC( /* XCreateIC failed. */ return; } + winPtr->ximGeneration = dispPtr->ximGeneration; /* * Adjust the window's event mask if the IM requires it. @@ -1288,6 +1289,14 @@ Tk_HandleEvent( */ #ifdef TK_USE_INPUT_METHODS + /* + * If the XIC has been invalidated, it must be recreated. + */ + if (winPtr->dispPtr->ximGeneration != winPtr->ximGeneration) { + winPtr->flags &= ~TK_CHECKED_IC; + winPtr->inputContext = NULL; + } + if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM)) { if (!(winPtr->flags & (TK_CHECKED_IC|TK_ALREADY_DEAD))) { winPtr->flags |= TK_CHECKED_IC; @@ -1295,7 +1304,9 @@ Tk_HandleEvent( CreateXIC(winPtr); } } - if (eventPtr->type == FocusIn && winPtr->inputContext != NULL) { + if ((eventPtr->type == FocusIn) && + (winPtr->dispPtr->inputMethod != NULL) && + (winPtr->inputContext != NULL)) { XSetICFocus(winPtr->inputContext); } } diff --git a/generic/tkInt.h b/generic/tkInt.h index 1615a81..f00d833 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -508,6 +508,9 @@ typedef struct TkDisplay { int iconDataSize; /* Size of default iconphoto image data. */ unsigned char *iconDataPtr; /* Default iconphoto image data, if set. */ +#ifdef TK_USE_INPUT_METHODS + int ximGeneration; /* Used to invalidate XIC */ +#endif /* TK_USE_INPUT_METHODS */ } TkDisplay; /* @@ -809,6 +812,9 @@ typedef struct TkWindow { int minReqWidth; /* Minimum requested width. */ int minReqHeight; /* Minimum requested height. */ char *geometryMaster; +#ifdef TK_USE_INPUT_METHODS + int ximGeneration; /* Used to invalidate XIC */ +#endif /* TK_USE_INPUT_METHODS */ } TkWindow; /* diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 5855b7c..85c5590 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -355,6 +355,9 @@ CreateTopLevelWindow( * Set the flags specified in the call. */ +#ifdef TK_USE_INPUT_METHODS + winPtr->ximGeneration = 0; +#endif /*TK_USE_INPUT_METHODS*/ winPtr->flags |= flags; /* @@ -472,6 +475,9 @@ GetScreen( dispPtr->cursorFont = None; dispPtr->warpWindow = NULL; dispPtr->multipleAtom = None; +#ifdef TK_USE_INPUT_METHODS + dispPtr->ximGeneration = 0; +#endif /*TK_USE_INPUT_METHODS*/ /* * By default we do want to collapse motion events in @@ -1442,10 +1448,11 @@ Tk_DestroyWindow( UnlinkWindow(winPtr); TkEventDeadWindow(winPtr); #ifdef TK_USE_INPUT_METHODS - if (winPtr->inputContext != NULL) { + if (winPtr->inputContext != NULL && + winPtr->ximGeneration == winPtr->dispPtr->ximGeneration) { XDestroyIC(winPtr->inputContext); - winPtr->inputContext = NULL; } + winPtr->inputContext = NULL; #endif /* TK_USE_INPUT_METHODS */ if (winPtr->tagPtr != NULL) { TkFreeBindingTags(winPtr); diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index f3beb16..111d430 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -38,6 +38,8 @@ static void DisplayFileProc(ClientData clientData, int flags); static void DisplaySetupProc(ClientData clientData, int flags); static void TransferXEventsToTcl(Display *display); #ifdef TK_USE_INPUT_METHODS +static void InstantiateIMCallback(Display *, XPointer client_data, XPointer call_data); +static void DestroyIMCallback(XIM im, XPointer client_data, XPointer call_data); static void OpenIM(TkDisplay *dispPtr); #endif @@ -179,6 +181,8 @@ TkpOpenDisplay( dispPtr->flags |= use_xkb; #ifdef TK_USE_INPUT_METHODS OpenIM(dispPtr); + XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL, + InstantiateIMCallback, (XPointer) dispPtr); #endif Tcl_CreateFileHandler(ConnectionNumber(display), TCL_READABLE, DisplayFileProc, dispPtr); @@ -664,6 +668,35 @@ TkpSync( } #ifdef TK_USE_INPUT_METHODS +static void +InstantiateIMCallback( + Display *display, + XPointer client_data, + XPointer call_data) +{ + TkDisplay *dispPtr; + + dispPtr = (TkDisplay *) client_data; + OpenIM(dispPtr); + XUnregisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL, + InstantiateIMCallback, (XPointer) dispPtr); +} + +static void +DestroyIMCallback( + XIM im, + XPointer client_data, + XPointer call_data) +{ + TkDisplay *dispPtr; + + dispPtr = (TkDisplay *) client_data; + dispPtr->inputMethod = NULL; + ++dispPtr->ximGeneration; + XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL, + InstantiateIMCallback, (XPointer) dispPtr); +} + /* *-------------------------------------------------------------- * @@ -693,11 +726,23 @@ OpenIM( return; } + ++dispPtr->ximGeneration; dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL); if (dispPtr->inputMethod == NULL) { return; } + /* Require X11R6 */ + { + XIMCallback destroy_cb; + + destroy_cb.callback = DestroyIMCallback; + destroy_cb.client_data = (XPointer) dispPtr; + if (XSetIMValues(dispPtr->inputMethod, XNDestroyCallback, + &destroy_cb, NULL)) + goto error; + } + if ((XGetIMValues(dispPtr->inputMethod, XNQueryInputStyle, &stylePtr, NULL) != NULL) || (stylePtr == NULL)) { goto error; @@ -744,6 +789,7 @@ error: if (dispPtr->inputMethod) { XCloseIM(dispPtr->inputMethod); dispPtr->inputMethod = NULL; + ++dispPtr->ximGeneration; } } #endif /* TK_USE_INPUT_METHODS */ -- cgit v0.12 From 07c65ee9c99b263ed8b6aefb42c7c5f6e47a441e Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 7 Jan 2017 14:51:58 +0000 Subject: Fix [ae32eb7e10]: Win + specific text widget configuration : textDisp-18.6, -20.2 -20.3 -20.4 fail --- generic/tkTextDisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 2171cd0..c060687 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -8793,7 +8793,7 @@ FinalizeBaseChunk( #if TK_DRAW_IN_CONTEXT newwidth = 0; CharChunkMeasureChars(chunkPtr, NULL, 0, 0, -1, 0, -1, 0, &newwidth); - if (newwidth != chunkPtr->width) { + if (newwidth < chunkPtr->width) { widthAdjust += newwidth - chunkPtr->width; chunkPtr->width = newwidth; } -- cgit v0.12 From 6a0d791579f271fd69868f377393a2e02ab5e82d Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 14 Jan 2017 14:32:30 +0000 Subject: Partially fix [fab5fed65e]: OS X - lots of textDisp failures (spurious 'borders' and indices in tk_textRedraw). This commit fixes the spurious indices part of the bug report. --- macosx/tkMacOSXDraw.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 474ed41..09a6b4e 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1527,12 +1527,6 @@ TkScrollWindow( srcRect = CGRectMake(x, y, width, height); dstRect = CGRectOffset(srcRect, dx, dy); - /* Expand the rectangles slightly to avoid degeneracies. */ - srcRect.origin.y -= 1; - srcRect.size.height += 2; - dstRect.origin.y += 1; - dstRect.size.height -= 2; - /* Compute the damage. */ dmgRgn = HIShapeCreateMutableWithRect(&srcRect); extraRgn = HIShapeCreateWithRect(&dstRect); -- cgit v0.12 From 32a7d700a16f886e7d863c0189979b4c89837001 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 15 Jan 2017 22:01:02 +0000 Subject: Partially fix [fab5fed65e]: OS X - lots of textDisp failures (spurious 'borders' and indices in tk_textRedraw). This commit fixes the 'borders' part of the bug report. --- macosx/tkMacOSXWindowEvent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index a669a8a..4672586 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -357,8 +357,8 @@ GenerateUpdates( event.xany.window = Tk_WindowId(winPtr); event.xany.display = Tk_Display(winPtr); event.type = Expose; - event.xexpose.x = damageBounds.origin.x - bounds.origin.x; - event.xexpose.y = damageBounds.origin.y - bounds.origin.y; + event.xexpose.x = damageBounds.origin.x; + event.xexpose.y = damageBounds.origin.y; event.xexpose.width = damageBounds.size.width; event.xexpose.height = damageBounds.size.height; event.xexpose.count = 0; -- cgit v0.12 From 886747e926ca6149ad730cbd07c59aa716f46435 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 15 Jan 2017 22:29:53 +0000 Subject: Remove obsolete comments. The line they comment was kicked out of the code in [946e946700]. Also, add a small optimization to avoid double invalidation of the damaged region. Indeed the detailed analysis of ticket [fab5fed65e] showed that on OS X the damaged region is invalidated twice: - once through the processing of the Expose event (on OS X the Appkit is not used to draw the widget, Tk is used instead, see comments in tkMacOSXWindowEvent.c around line 770) - a second time because DisplayText() calls TextInvalidateRegion() after TkScrollWindow() --- generic/tkTextDisp.c | 3 ++- macosx/tkMacOSXDraw.c | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 1be26c4..c271b4b 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4299,8 +4299,9 @@ DisplayText( if (TkScrollWindow(textPtr->tkwin, dInfoPtr->scrollGC, dInfoPtr->x, oldY, dInfoPtr->maxX-dInfoPtr->x, height, 0, y-oldY, damageRgn)) { +#ifndef MAC_OSX_TK TextInvalidateRegion(textPtr, damageRgn); - +#endif } numCopies++; TkDestroyRegion(damageRgn); diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 09a6b4e..5ca8bfe 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1565,9 +1565,6 @@ TkScrollWindow( int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); [view generateExposeEvents:dmgRgn childrenOnly:1]; Tcl_SetServiceMode(oldMode); - - /* Belt and suspenders: make the AppKit request a redraw - when it gets control again. */ } } else { dmgRgn = HIShapeCreateEmpty(); -- cgit v0.12 From c558898981a43637a64c17a40fd816ae41991961 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 18 Jan 2017 12:44:22 +0000 Subject: Change more refCount checks to the form "(...refCount-- <= 1)", so no separate decrement and compare is necessary. This allows (in the future) the same code to work when refCount becomes unsigned (which at least doubles the range). No functional change. --- generic/tkImgPhInstance.c | 3 +-- generic/tkText.c | 12 ++++-------- generic/tkTextDisp.c | 9 ++++----- generic/tkTextIndex.c | 2 +- generic/tkTextTag.c | 5 ++--- generic/tkWindow.c | 3 +-- 6 files changed, 13 insertions(+), 21 deletions(-) diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c index bd152f2..98aaeab 100644 --- a/generic/tkImgPhInstance.c +++ b/generic/tkImgPhInstance.c @@ -721,8 +721,7 @@ TkImgPhotoFree( PhotoInstance *instancePtr = clientData; ColorTable *colorPtr; - instancePtr->refCount -= 1; - if (instancePtr->refCount > 0) { + if (instancePtr->refCount-- > 1) { return; } diff --git a/generic/tkText.c b/generic/tkText.c index 412a7f2..6ff1db9 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1570,8 +1570,7 @@ TextWidgetObjCmd( } done: - textPtr->refCount--; - if (textPtr->refCount == 0) { + if (textPtr->refCount-- <= 1) { ckfree(textPtr); } return result; @@ -1964,9 +1963,7 @@ DestroyText( * portion of the text widget. */ - sharedTextPtr->refCount--; - - if (sharedTextPtr->refCount > 0) { + if (sharedTextPtr->refCount-- > 1) { TkBTreeRemoveClient(sharedTextPtr->tree, textPtr); /* @@ -2042,13 +2039,12 @@ DestroyText( } textPtr->tkwin = NULL; - textPtr->refCount--; Tcl_DeleteCommandFromToken(textPtr->interp, textPtr->widgetCmd); if (textPtr->afterSyncCmd){ Tcl_DecrRefCount(textPtr->afterSyncCmd); textPtr->afterSyncCmd = NULL; } - if (textPtr->refCount == 0) { + if (textPtr->refCount-- <= 1) { ckfree(textPtr); } } @@ -5526,7 +5522,7 @@ RunAfterSyncCmd( * The widget has been deleted. Don't do anything. */ - if (--textPtr->refCount == 0) { + if (textPtr->refCount-- <= 1) { ckfree((char *) textPtr); } return; diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 1be26c4..704d47d 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3005,7 +3005,7 @@ AsyncUpdateLineMetrics( * The widget has been deleted, or is not mapped. Don't do anything. */ - if (--textPtr->refCount == 0) { + if (textPtr->refCount-- <= 1) { ckfree(textPtr); } return; @@ -3080,8 +3080,7 @@ AsyncUpdateLineMetrics( GenerateWidgetViewSyncEvent(textPtr, 1); - textPtr->refCount--; - if (textPtr->refCount == 0) { + if (textPtr->refCount-- <= 1) { ckfree(textPtr); } return; @@ -4163,7 +4162,7 @@ DisplayText( textPtr->refCount++; dInfoPtr->flags &= ~REPICK_NEEDED; TkTextPickCurrent(textPtr, &textPtr->pickEvent); - if (--textPtr->refCount == 0) { + if (textPtr->refCount-- <= 1) { ckfree(textPtr); goto end; } @@ -6752,7 +6751,7 @@ AsyncUpdateYScrollbar( GetYView(textPtr->interp, textPtr, 1); } - if (--textPtr->refCount == 0) { + if (textPtr->refCount-- <= 1) { ckfree(textPtr); } } diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index d227bd8..faa1afd 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -87,7 +87,7 @@ FreeTextIndexInternalRep( TkTextIndex *indexPtr = GET_TEXTINDEX(indexObjPtr); if (indexPtr->textPtr != NULL) { - if (--indexPtr->textPtr->refCount == 0) { + if (indexPtr->textPtr->refCount-- <= 1) { /* * The text widget has been deleted and we need to free it now. */ diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index dd3127d..d9329f5 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -1258,8 +1258,7 @@ TkTextFreeTag( if (textPtr != tagPtr->textPtr) { Tcl_Panic("Tag being deleted from wrong widget"); } - textPtr->refCount--; - if (textPtr->refCount == 0) { + if (textPtr->refCount-- <= 1) { ckfree(textPtr); } tagPtr->textPtr = NULL; @@ -1522,7 +1521,7 @@ TkTextBindProc( } done: - if (--textPtr->refCount == 0) { + if (textPtr->refCount-- <= 1) { ckfree(textPtr); } } diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 5855b7c..20b4f20 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -1479,8 +1479,7 @@ Tk_DestroyWindow( winPtr->mainPtr->deletionEpoch++; } - winPtr->mainPtr->refCount--; - if (winPtr->mainPtr->refCount == 0) { + if (winPtr->mainPtr->refCount-- <= 1) { register const TkCmd *cmdPtr; /* -- cgit v0.12 From 5442c2a77a9c025b2245d42dbae20829f03be9bc Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 18 Jan 2017 12:45:33 +0000 Subject: Use the win32 Wide API in some more places. And some simplifications, since we no longer support win95/98/ME --- win/tkWinClipboard.c | 11 +---------- win/tkWinFont.c | 41 ++++++++++++++++------------------------- win/tkWinMenu.c | 46 ++++++++++++++++++++++------------------------ 3 files changed, 39 insertions(+), 59 deletions(-) diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 200883f..929070b 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -414,16 +414,7 @@ UpdateClipboard( OpenClipboard(hwnd); EmptyClipboard(); - /* - * CF_UNICODETEXT is only supported on NT, but it it is prefered when - * possible. - */ - - if (TkWinGetPlatformId() != VER_PLATFORM_WIN32_WINDOWS) { - SetClipboardData(CF_UNICODETEXT, NULL); - } else { - SetClipboardData(CF_TEXT, NULL); - } + SetClipboardData(CF_UNICODETEXT, NULL); CloseClipboard(); TkWinUpdatingClipboard(FALSE); } diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 860451b..ea8a7a2 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -262,16 +262,7 @@ void TkpFontPkgInit( TkMainInfo *mainPtr) /* The application being created. */ { - if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) { - /* - * If running NT, then we will be calling some Unicode functions - * explictly. So, even if the Tcl system encoding isn't Unicode, make - * sure we convert to/from the Unicode char set. - */ - - systemEncoding = TkWinGetUnicodeEncoding(); - } - + systemEncoding = TkWinGetUnicodeEncoding(); TkWinSetupSystemFonts(mainPtr); } @@ -760,14 +751,14 @@ TkpGetFontAttrsForChar( * character */ FontFamily *familyPtr = thisSubFontPtr->familyPtr; HFONT oldfont; /* Saved font from the device context */ - TEXTMETRICA tm; /* Font metrics of the selected subfont */ + TEXTMETRIC tm; /* Font metrics of the selected subfont */ /* * Get the font attributes. */ oldfont = SelectObject(hdc, thisSubFontPtr->hFont0); - GetTextMetricsA(hdc, &tm); + GetTextMetrics(hdc, &tm); SelectObject(hdc, oldfont); ReleaseDC(fontPtr->hwnd, hdc); faPtr->family = familyPtr->faceName; @@ -1118,7 +1109,7 @@ Tk_DrawChars( HBRUSH oldBrush, stipple; HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRICA tm; + TEXTMETRIC tm; SIZE size; if (twdPtr->type != TWD_BITMAP) { @@ -1145,7 +1136,7 @@ Tk_DrawChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetricsA(dcMem, &tm); + GetTextMetrics(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1184,7 +1175,7 @@ Tk_DrawChars( } else { HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRICA tm; + TEXTMETRIC tm; SIZE size; dcMem = CreateCompatibleDC(dc); @@ -1199,7 +1190,7 @@ Tk_DrawChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetricsA(dcMem, &tm); + GetTextMetrics(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1266,7 +1257,7 @@ TkDrawAngledChars( HBRUSH oldBrush, stipple; HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRICA tm; + TEXTMETRIC tm; SIZE size; if (twdPtr->type != TWD_BITMAP) { @@ -1293,7 +1284,7 @@ TkDrawAngledChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetricsA(dcMem, &tm); + GetTextMetrics(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1332,7 +1323,7 @@ TkDrawAngledChars( } else { HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRICA tm; + TEXTMETRIC tm; SIZE size; dcMem = CreateCompatibleDC(dc); @@ -1347,7 +1338,7 @@ TkDrawAngledChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetricsA(dcMem, &tm); + GetTextMetrics(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1454,11 +1445,11 @@ MultiFontTextOut( Tcl_DString runString; const char *p, *end, *next; SubFont *lastSubFontPtr, *thisSubFontPtr; - TEXTMETRICA tm; + TEXTMETRIC tm; lastSubFontPtr = &fontPtr->subFontArray[0]; oldFont = SelectFont(hdc, fontPtr, lastSubFontPtr, angle); - GetTextMetricsA(hdc, &tm); + GetTextMetrics(hdc, &tm); end = source + numBytes; for (p = source; p < end; ) { @@ -1482,7 +1473,7 @@ MultiFontTextOut( lastSubFontPtr = thisSubFontPtr; source = p; SelectFont(hdc, fontPtr, lastSubFontPtr, angle); - GetTextMetricsA(hdc, &tm); + GetTextMetrics(hdc, &tm); } p = next; } @@ -1560,7 +1551,7 @@ InitFont( HDC hdc; HWND hwnd; HFONT oldFont; - TEXTMETRICA tm; + TEXTMETRIC tm; Window window; TkFontMetrics *fmPtr; Tcl_Encoding encoding; @@ -1573,7 +1564,7 @@ InitFont( hdc = GetDC(hwnd); oldFont = SelectObject(hdc, hFont); - GetTextMetricsA(hdc, &tm); + GetTextMetrics(hdc, &tm); /* * On any version NT, there may fonts with international names. Use the diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 8e14669..3cf7c10 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -900,7 +900,7 @@ TkWinMenuProc( LRESULT lResult; if (!TkWinHandleMenuEvent(&hwnd, &message, &wParam, &lParam, &lResult)) { - lResult = DefWindowProcA(hwnd, message, wParam, lParam); + lResult = DefWindowProc(hwnd, message, wParam, lParam); } return lResult; } @@ -999,7 +999,7 @@ TkWinEmbeddedMenuProc( } default: - lResult = DefWindowProcA(hwnd, message, wParam, lParam); + lResult = DefWindowProc(hwnd, message, wParam, lParam); break; } return lResult; @@ -2036,33 +2036,33 @@ TkWinMenuKeyObjCmd( if (eventPtr->type == KeyPress) { switch (keySym) { case XK_Alt_L: - scanCode = MapVirtualKeyA(VK_LMENU, 0); - CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKey(VK_LMENU, 0); + CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYDOWN, VK_MENU, (int) (scanCode << 16) | (1 << 29)); break; case XK_Alt_R: - scanCode = MapVirtualKeyA(VK_RMENU, 0); - CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKey(VK_RMENU, 0); + CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYDOWN, VK_MENU, (int) (scanCode << 16) | (1 << 29) | (1 << 24)); break; case XK_F10: - scanCode = MapVirtualKeyA(VK_F10, 0); - CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKey(VK_F10, 0); + CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYDOWN, VK_F10, (int) (scanCode << 16)); break; default: virtualKey = XKeysymToKeycode(winPtr->display, keySym); - scanCode = MapVirtualKeyA(virtualKey, 0); + scanCode = MapVirtualKey(virtualKey, 0); if (0 != scanCode) { XKeyEvent xkey = eventPtr->xkey; - CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)), + CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYDOWN, virtualKey, (int) ((scanCode << 16) | (1 << 29))); if (xkey.nbytes > 0) { for (i = 0; i < xkey.nbytes; i++) { - CallWindowProcA(DefWindowProcA, + CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSCHAR, xkey.trans_chars[i], (int) ((scanCode << 16) | (1 << 29))); @@ -2073,28 +2073,28 @@ TkWinMenuKeyObjCmd( } else if (eventPtr->type == KeyRelease) { switch (keySym) { case XK_Alt_L: - scanCode = MapVirtualKeyA(VK_LMENU, 0); - CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKey(VK_LMENU, 0); + CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYUP, VK_MENU, (int) (scanCode << 16) | (1 << 29) | (1 << 30) | (1 << 31)); break; case XK_Alt_R: - scanCode = MapVirtualKeyA(VK_RMENU, 0); - CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKey(VK_RMENU, 0); + CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYUP, VK_MENU, (int) (scanCode << 16) | (1 << 24) | (0x111 << 29) | (1 << 30) | (1 << 31)); break; case XK_F10: - scanCode = MapVirtualKeyA(VK_F10, 0); - CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKey(VK_F10, 0); + CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYUP, VK_F10, (int) (scanCode << 16) | (1 << 30) | (1 << 31)); break; default: virtualKey = XKeysymToKeycode(winPtr->display, keySym); - scanCode = MapVirtualKeyA(virtualKey, 0); + scanCode = MapVirtualKey(virtualKey, 0); if (0 != scanCode) { - CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)), + CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYUP, virtualKey, (int) ((scanCode << 16) | (1 << 29) | (1 << 30) | (1 << 31))); } @@ -3199,7 +3199,7 @@ SetDefaults( HDC scratchDC; int bold = 0; int italic = 0; - TEXTMETRICA tm; + TEXTMETRIC tm; int pointSize; HFONT menuFont; /* See: [Bug #3239768] tk8.4.19 (and later) WIN32 menu font support */ @@ -3239,7 +3239,7 @@ SetDefaults( &nc.metrics, 0); menuFont = CreateFontIndirect(&nc.metrics.lfMenuFont); SelectObject(scratchDC, menuFont); - GetTextMetricsA(scratchDC, &tm); + GetTextMetrics(scratchDC, &tm); GetTextFaceA(scratchDC, LF_FACESIZE, faceName); pointSize = MulDiv(tm.tmHeight - tm.tmInternalLeading, 72, GetDeviceCaps(scratchDC, LOGPIXELSY)); @@ -3295,9 +3295,7 @@ SetDefaults( */ showMenuAccelerators = TRUE; - if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) { - SystemParametersInfoA(SPI_GETKEYBOARDCUES, 0, &showMenuAccelerators, 0); - } + SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &showMenuAccelerators, 0); } /* -- cgit v0.12 From 3fb089ed701dcab661c4b34a2ea70bef7d5d9516 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 21 Jan 2017 13:06:08 +0000 Subject: Fix [ed22529c92]: Spinbox validation is turned off when validate function returns false --- doc/spinbox.n | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/spinbox.n b/doc/spinbox.n index 330bb17..acf06d6 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -217,15 +217,19 @@ were editing the spinbox widget from). It is also recommended to not set an associated \fB\-textvariable\fR during validation, as that can cause the spinbox widget to become out of sync with the \fB\-textvariable\fR. .PP -Also, the \fBvalidate\fR option will set itself to \fBnone\fR when the -spinbox value gets changed because of adjustment of \fBfrom\fR or \fBto\fR -and the \fBvalidateCommand\fR returns false. For instance +Also, the \fB-validate\fR option will set itself to \fBnone\fR when the +spinbox value gets changed because of adjustment of \fB-from\fR or \fB-to\fR +and the \fB-validatecommand\fR returns false. For instance .CS \fIspinbox pathName \-from 1 \-to 10 \-validate all \-vcmd {return 0}\fR .CE -will in fact set the \fBvalidate\fR option to \fBnone\fR because the default -value for the spinbox gets changed (due to the \fBfrom\fR and \fBto\fR +will in fact set the \fB-validate\fR option to \fBnone\fR because the default +value for the spinbox gets changed (due to the \fB-from\fR and \fB-to\fR options) to a value not accepted by the validation script. +.PP +Moreover, forced validation is performed when invoking any spinbutton of +the spinbox. If the validation script returns false in this situation, +then the \fB-validate\fR option will be automatically set to \fBnone\fR. .SH "WIDGET COMMAND" .PP The \fBspinbox\fR command creates a new Tcl command whose -- cgit v0.12 From dabee7102b4e83ddd4784375631348c6b1ed0e11 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 22 Jan 2017 09:05:57 +0000 Subject: Fix [89a638af38]: OS X - textDisp-15.8 fails --- tests/textDisp.test | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index d3de2d8..8342c46 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1952,13 +1952,15 @@ test textDisp-15.8 {Scrolling near end of window} { .tf.f.t insert end "\nLine $i" } update ; after 1000 ; update + set refind [.tf.f.t index @0,[winfo height .tf.f.t]] # Should scroll and should not crash! .tf.f.t yview scroll 1 unit # Check that it has scrolled - set res [.tf.f.t index @0,[expr [winfo height .tf.f.t] - 15]] + set newind [.tf.f.t index @0,[winfo height .tf.f.t]] + set res [.tf.f.t compare $newind > $refind] destroy .tf set res -} {12.0} +} {1} .t configure -wrap char .t delete 1.0 end -- cgit v0.12 From 19702c5a40b368d9d39834a373f4745782de16e3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 28 Jan 2017 15:41:45 +0000 Subject: Proposed fix for [499526180d]: Add support for windows multimedia virtual keys. Patch by ralfixx --- generic/ks_names.h | 7 +++++++ win/tkWinKey.c | 11 +++++++++-- xlib/X11/keysymdef.h | 12 ++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/generic/ks_names.h b/generic/ks_names.h index 22d9fc5..b939a51 100644 --- a/generic/ks_names.h +++ b/generic/ks_names.h @@ -920,3 +920,10 @@ { "hebrew_shin", 0xcf9 }, { "hebrew_taf", 0xcfa }, { "Hebrew_switch", 0xFF7E }, +{ "XF86AudioLowerVolume", 0x1008FF11 }, +{ "XF86AudioMute", 0x1008FF12 }, +{ "XF86AudioRaiseVolume", 0x1008FF13 }, +{ "XF86AudioPlay", 0x1008FF14 }, +{ "XF86AudioStop", 0x1008FF15 }, +{ "XF86AudioPrev", 0x1008FF16 }, +{ "XF86AudioNext", 0x1008FF17 }, diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 1ebf312..357a804 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -21,7 +21,8 @@ * like a worthwhile improvement to use the table. */ -#define MAX_KEYCODE 145 /* VK_SCROLL is the last entry in our table below */ +#define MAX_KEYCODE 179 /* VK_MEDIA_PLAY_PAUSE is the last entry in our table below */ +/* cf. https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx */ static const KeySym keymap[] = { NoSymbol, NoSymbol, NoSymbol, XK_Cancel, NoSymbol, @@ -53,7 +54,13 @@ static const KeySym keymap[] = { XK_F19, XK_F20, XK_F21, XK_F22, XK_F23, XK_F24, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, XK_Num_Lock, - XK_Scroll_Lock + XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, /*150 0x96*/ + NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, /*155 0x9b*/ + NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, /*160 0xa0*/ + NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, /*165 0xa5*/ + NoSymbol, NoSymbol, NoSymbol, XK_XF86AudioMute, XK_XF86AudioLowerVolume, /*170 0xaa*/ + XK_XF86AudioRaiseVolume, XK_XF86AudioNext, XK_XF86AudioPrev, XK_XF86AudioStop, XK_XF86AudioPlay /*175 0xaf*/ }; /* diff --git a/xlib/X11/keysymdef.h b/xlib/X11/keysymdef.h index b22d41b..a7c654d 100644 --- a/xlib/X11/keysymdef.h +++ b/xlib/X11/keysymdef.h @@ -1167,3 +1167,15 @@ SOFTWARE. #define XK_Hebrew_switch 0xFF7E /* Alias for mode_switch */ #endif /* XK_HEBREW */ +/* Multimedia keys, defined same as on Linux + * /usr/include/pkg/libxkbcommon/xkbcommon/xkbcommon-keysyms.h + */ + +#define XK_XF86AudioLowerVolume 0x1008FF11 /* Volume control down */ +#define XK_XF86AudioMute 0x1008FF12 /* Mute sound from the system */ +#define XK_XF86AudioRaiseVolume 0x1008FF13 /* Volume control up */ +#define XK_XF86AudioPlay 0x1008FF14 /* Start playing of audio > */ +#define XK_XF86AudioStop 0x1008FF15 /* Stop playing audio */ +#define XK_XF86AudioPrev 0x1008FF16 /* Previous track */ +#define XK_XF86AudioNext 0x1008FF17 /* Next track */ + -- cgit v0.12 From c39e643b30e956481203d8f38e1a396230368a57 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 29 Jan 2017 15:01:36 +0000 Subject: Remove obsolete (and currently wrong) comment in generic/ks_names.h --- generic/ks_names.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/generic/ks_names.h b/generic/ks_names.h index b939a51..af73d3b 100644 --- a/generic/ks_names.h +++ b/generic/ks_names.h @@ -1,6 +1,3 @@ -/* - * This file is generated from $(INCLUDESRC)/keysymdef.h. Do not edit. - */ { "BackSpace", 0xFF08 }, { "Tab", 0xFF09 }, { "Linefeed", 0xFF0A }, -- cgit v0.12 From 161ab94f1c1e0e903cd217f89ff6981d9cd74923 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 29 Jan 2017 16:48:38 +0000 Subject: Remove superfluous 'textfonts' constraint in textDisp-20.1,2,3,4,5 --- tests/textDisp.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index 8342c46..44e3edc 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -2873,28 +2873,28 @@ for {set i 2} {$i <= 200} {incr i} { .t configure -wrap word .t delete 50.0 51.0 .t insert 50.0 "This is a long line, one that will wrap around twice.\n" -test textDisp-20.1 {FindDLine} {textfonts} { +test textDisp-20.1 {FindDLine} { .t yview 48.0 list [.t dlineinfo 46.0] [.t dlineinfo 47.0] [.t dlineinfo 49.0] \ [.t dlineinfo 58.0] } [list {} {} [list 3 [expr {$fixedDiff + 16}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}] -test textDisp-20.2 {FindDLine} {textfonts} { +test textDisp-20.2 {FindDLine} { .t yview 100.0 .t yview -pickplace 53.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.14] [.t dlineinfo 50.21] } [list [list 3 [expr {-1 - $fixedDiff/2}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {-1 - $fixedDiff/2}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {12 + $fixedDiff/2}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]] -test textDisp-20.3 {FindDLine} {textfonts} { +test textDisp-20.3 {FindDLine} { .t yview 100.0 .t yview 49.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 57.0] } [list [list 3 [expr {$fixedDiff + 16}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {2*$fixedDiff + 29}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}] -test textDisp-20.4 {FindDLine} {textfonts} { +test textDisp-20.4 {FindDLine} { .t yview 100.0 .t yview 42.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 50.40] } [list [list 3 [expr {8*$fixedDiff + 107}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {9*$fixedDiff + 120}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}] .t config -wrap none -test textDisp-20.5 {FindDLine} {textfonts} { +test textDisp-20.5 {FindDLine} { .t yview 100.0 .t yview 48.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.20] [.t dlineinfo 50.40] -- cgit v0.12 From f802dd59b9fdec91f7178bfb7bcaa2ab2818739c Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 29 Jan 2017 17:11:28 +0000 Subject: Add comment explaining that ks_names.h should be kept in sync with keysymdef.h, and explain why this needs to be done manually. --- generic/ks_names.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/generic/ks_names.h b/generic/ks_names.h index af73d3b..9f49130 100644 --- a/generic/ks_names.h +++ b/generic/ks_names.h @@ -1,3 +1,16 @@ +/* + * This file should be maintained in sync with xlib/X11/keysymdefs.h + * + * Note that this should be done manually only, because in some cases + * keysymdefs.h defines the same integer for multiple keysyms, e.g.: + * + * #define XK_Greek_LAMDA 0x7cb + * #define XK_Greek_LAMBDA 0x7cb + * + * #define XK_Cyrillic_DZHE 0x6bf + * #define XK_Serbian_DZE 0x6bf (deprecated) + * + */ { "BackSpace", 0xFF08 }, { "Tab", 0xFF09 }, { "Linefeed", 0xFF0A }, -- cgit v0.12 From 0691533b9281b179d99856732c3eb28f6a4256cf Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 1 Feb 2017 21:09:34 +0000 Subject: Remove old pack syntax from the scripts of the Tk test suite --- tests/focusTcl.test | 8 ++++---- tests/pack.test | 4 ++-- tests/text.test | 30 +++++++++++++++--------------- tests/textDisp.test | 6 +++--- tests/textIndex.test | 6 +++--- tests/textMark.test | 2 +- tests/textTag.test | 2 +- tests/textWind.test | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/focusTcl.test b/tests/focusTcl.test index ef848bb..0e457a6 100644 --- a/tests/focusTcl.test +++ b/tests/focusTcl.test @@ -402,7 +402,7 @@ test focusTcl-5.4 {tkFocusOK procedure, -takefocus ""} -body { test focusTcl-5.5 {tkFocusOK procedure, -takefocus "", not mapped} -body { setup1 . .b.x configure -takefocus "" - pack unpack .b.x + pack forget .b.x update tk_focusNext .b } -cleanup { @@ -413,7 +413,7 @@ test focusTcl-5.6 {tkFocusOK procedure, -takefocus "", not mapped} -body { foreach w {.b.x .b.y .b.z} { $w configure -takefocus "" } - pack unpack .b + pack forget .b update tk_focusNext .b } -cleanup { @@ -422,7 +422,7 @@ test focusTcl-5.6 {tkFocusOK procedure, -takefocus "", not mapped} -body { test focusTcl-5.7 {tkFocusOK procedure, -takefocus "", not mapped} -body { setup1 . .b.y configure -takefocus 1 - pack unpack .b.y + pack forget .b.y update tk_focusNext .b.x } -cleanup { @@ -432,7 +432,7 @@ test focusTcl-5.8 {tkFocusOK procedure, -takefocus "", not mapped} -body { proc always args {return 1} setup1 . .b.y configure -takefocus always - pack unpack .b.y + pack forget .b.y update tk_focusNext .b.x } -cleanup { diff --git a/tests/pack.test b/tests/pack.test index eac1562..efb262b 100644 --- a/tests/pack.test +++ b/tests/pack.test @@ -1403,7 +1403,7 @@ test pack-15.1 {managing geometry with -in option} -setup { pack .pack.b -in .pack.f.f2 update set result [winfo geom .pack.b] - pack unpack .pack.a + pack forget .pack.a update lappend result [winfo geom .pack.b] } -cleanup { @@ -1441,7 +1441,7 @@ test pack-15.3 {managing geometry with -in option} -setup { pack .pack.b -in .pack.f.f2 update set result [winfo ismapped .pack.b] - pack unpack .pack.f + pack forget .pack.f update lappend result [winfo ismapped .pack.b] } -cleanup { diff --git a/tests/text.test b/tests/text.test index 6812855..edd2a6e 100644 --- a/tests/text.test +++ b/tests/text.test @@ -2631,7 +2631,7 @@ test text-10.37 {TextWidgetCmd procedure, "count" option} -setup { } -result {3} test text-10.38 {TextWidgetCmd procedure, "count" option} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both } -body { .t configure -width 20 -height 10 update @@ -2727,7 +2727,7 @@ test text-9.2.47 {TextWidgetCmd procedure, "count" option} -setup { test text-11.1 {counting with tag priority eliding} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both } -body { .t insert end "hello" .t configure -wrap none @@ -2744,7 +2744,7 @@ test text-11.1 {counting with tag priority eliding} -setup { } -result {0 1 2 3 4 5 5 6} test text-11.2 {counting with tag priority eliding} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both } -body { .t insert end "hello" .t tag configure elide1 -elide 0 @@ -2856,7 +2856,7 @@ test text-11.7 {counting with tag priority eliding} -setup { } -result {5 5} test text-11.8 {counting with tag priority eliding} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both set res {} } -body { .t insert end "hello" @@ -2882,7 +2882,7 @@ test text-11.8 {counting with tag priority eliding} -setup { } -result {0 0 0 0 3 2 1 1} test text-11.9 {counting with tag priority eliding} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both set res {} } -body { .t tag configure WELCOME -elide 1 @@ -3432,7 +3432,7 @@ test text-14.18 {ConfigureText procedure} -constraints fonts -setup { text .top.t -font {Courier -12} -borderwidth 2 -highlightthickness 2 } -body { .top.t configure -width 20 -height 10 - pack append .top .top.t top + pack .top.t update set geom [wm geometry .top] set x [string range $geom 0 [string first + $geom]] @@ -3449,7 +3449,7 @@ test text-14.19 {ConfigureText procedure} -setup { } -body { .top.t configure -width 20 -height 10 -setgrid 1 wm overrideredirect .top 1 - pack append .top .top.t top + pack .top.t wm geometry .top +0+0 update wm geometry .top @@ -3466,7 +3466,7 @@ test text-14.20 {ConfigureText procedure} -setup { } -body { .top.t configure -width 20 -height 10 -setgrid 1 wm overrideredirect .top 1 - pack append .top .top.t top + pack .top.t wm geometry .top +0+0 update set result [wm geometry .top] @@ -3756,7 +3756,7 @@ Line 4 test text-19.11 {DeleteChars procedure} -body { toplevel .top text .top.t -width 20 -height 5 - pack append .top .top.t top + pack .top.t wm geometry .top +0+0 .top.t insert 1.0 "abc\n123\nx\ny\nz\nq\nr\ns" update @@ -3768,7 +3768,7 @@ test text-19.11 {DeleteChars procedure} -body { test text-19.12 {DeleteChars procedure} -body { toplevel .top text .top.t -width 20 -height 5 - pack append .top .top.t top + pack .top.t wm geometry .top +0+0 .top.t insert 1.0 "abc\n123\nx\ny\nz\nq\nr\ns" .top.t yview 3.0 @@ -3841,7 +3841,7 @@ test text-19.16 {DeleteChars procedure, updates affecting topIndex} -setup { test text-20.1 {TextFetchSelection procedure} -setup { text .t -width 20 -height 10 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both update } -body { foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} { @@ -3856,7 +3856,7 @@ b.0b.1b.2b.3b.4 c.0c} test text-20.2 {TextFetchSelection procedure} -setup { text .t -width 20 -height 10 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both update } -body { foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} { @@ -3876,7 +3876,7 @@ b.0b.1b.2b.3b.4 c.0c} test text-20.3 {TextFetchSelection procedure} -setup { text .t -width 20 -height 10 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both update } -body { foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} { @@ -3890,7 +3890,7 @@ test text-20.3 {TextFetchSelection procedure} -setup { } -result {m} test text-20.4 {TextFetchSelection procedure} -setup { text .t -width 20 -height 10 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both update } -body { foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} { @@ -3910,7 +3910,7 @@ test text-20.4 {TextFetchSelection procedure} -setup { cj.0j.1j.2j.3j.4m} test text-20.5 {TextFetchSelection procedure, long selections} -setup { text .t -width 20 -height 10 - pack append . .t {top expand fill} + pack .t -expand 1 -fill both update set x "" } -body { diff --git a/tests/textDisp.test b/tests/textDisp.test index 8342c46..a3a4553 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -39,7 +39,7 @@ option add *Text.highlightThickness $twht catch {destroy .f .t} frame .f -width 100 -height 20 -pack append . .f left +pack .f -side left set fixedFont {Courier -12} # 15 on XP, 13 on Solaris 8 @@ -65,7 +65,7 @@ set bigAscent [font metrics $bigFont -ascent] set ascentDiff [expr {$bigAscent - $fixedAscent}] text .t -font $fixedFont -width 20 -height 10 -yscrollcommand scroll -pack append . .t {top expand fill} +pack .t -expand 1 -fill both .t tag configure big -font $bigFont .t debug on wm geometry . {} @@ -599,7 +599,7 @@ test textDisp-4.6 {UpdateDisplayInfo, tiny window} { wm overrideredirect . 1 } frame .f2 -width 20 -height 100 - pack before .f .f2 top + pack .f2 -before .f wm geom . 103x103 update .t configure -wrap none -borderwidth 2 diff --git a/tests/textIndex.test b/tests/textIndex.test index 83a249e..7d44516 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -13,7 +13,7 @@ namespace import -force tcltest::test catch {destroy .t} text .t -font {Courier -12} -width 20 -height 10 -pack append . .t {top expand fill} +pack .t -expand 1 -fill both update .t debug on wm geometry . {} @@ -714,7 +714,7 @@ test textIndex-18.1 {Object indices don't cache mark names} { } {3.4 3.0 1.0} frame .f -width 100 -height 20 -pack append . .f left +pack .f -side left set fixedFont {Courier -12} set fixedHeight [font metrics $fixedFont -linespace] @@ -724,7 +724,7 @@ set varFont {Times -14} set bigFont {Helvetica -24} destroy .t text .t -font $fixedFont -width 20 -height 10 -wrap char -pack append . .t {top expand fill} +pack .t -expand 1 -fill both .t tag configure big -font $bigFont .t debug on wm geometry . {} diff --git a/tests/textMark.test b/tests/textMark.test index edd0e92..bbf226e 100644 --- a/tests/textMark.test +++ b/tests/textMark.test @@ -13,7 +13,7 @@ tcltest::loadTestedCommands destroy .t text .t -width 20 -height 10 -pack append . .t {top expand fill} +pack .t -expand 1 -fill both update .t debug on wm geometry . {} diff --git a/tests/textTag.test b/tests/textTag.test index 88081d0..ddbaa3b 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -17,7 +17,7 @@ testConstraint haveCourier12 [expr {[catch { .t configure -font {Courier 12} }] == 0}] -pack append . .t {top expand fill} +pack .t -expand 1 -fill both update .t debug on diff --git a/tests/textWind.test b/tests/textWind.test index 27b7309..fd29e19 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -22,7 +22,7 @@ option add *Text.font {Courier -12} deleteWindows # Widget used in tests 1.* - 16.* text .t -width 30 -height 6 -bd 2 -highlightthickness 2 -pack append . .t {top expand fill} +pack .t -expand 1 -fill both update .t debug on -- cgit v0.12 From 57fc44c584797fe0a1f04d80fa255ad5e3339b86 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 8 Feb 2017 18:22:34 +0000 Subject: Fix [c492c96aa2]: Combobox arrow not grayed (alt, clam and default ttk themes) --- library/ttk/altTheme.tcl | 1 + library/ttk/clamTheme.tcl | 1 + library/ttk/defaults.tcl | 1 + 3 files changed, 3 insertions(+) diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl index e792539..9aa6061 100644 --- a/library/ttk/altTheme.tcl +++ b/library/ttk/altTheme.tcl @@ -64,6 +64,7 @@ namespace eval ttk::theme::alt { ttk::style configure TCombobox -padding 1 ttk::style map TCombobox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] + ttk::style map TCombobox -arrowcolor [list disabled $colors(-disabledfg)] ttk::style configure ComboboxPopdownFrame \ -relief solid -borderwidth 1 diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index f4ad43b..b278e3f 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -111,6 +111,7 @@ namespace eval ttk::theme::clam { readonly $colors(-frame)] \ -foreground [list {readonly focus} $colors(-selectfg)] \ ; + ttk::style map TCombobox -arrowcolor [list disabled $colors(-disabledfg)] ttk::style configure ComboboxPopdownFrame \ -relief solid -borderwidth 1 diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 853ed20..f38a4a2 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -74,6 +74,7 @@ namespace eval ttk::theme::default { -relief sunken -fieldbackground white -padding 1 ttk::style map TEntry -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] + ttk::style map TCombobox -arrowcolor [list disabled $colors(-disabledfg)] ttk::style configure TCombobox -arrowsize 12 -padding 1 ttk::style map TCombobox -fieldbackground \ -- cgit v0.12 From cb619ed5ddc6047ebf6fff8c2c64a42c37e95926 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 9 Feb 2017 19:28:56 +0000 Subject: Group multiple [style map TCombobox] statements into a single instruction --- library/ttk/altTheme.tcl | 4 ++-- library/ttk/clamTheme.tcl | 3 +-- library/ttk/defaults.tcl | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl index 9aa6061..5630e6c 100644 --- a/library/ttk/altTheme.tcl +++ b/library/ttk/altTheme.tcl @@ -63,8 +63,8 @@ namespace eval ttk::theme::alt { [list readonly $colors(-frame) disabled $colors(-frame)] ttk::style configure TCombobox -padding 1 ttk::style map TCombobox -fieldbackground \ - [list readonly $colors(-frame) disabled $colors(-frame)] - ttk::style map TCombobox -arrowcolor [list disabled $colors(-disabledfg)] + [list readonly $colors(-frame) disabled $colors(-frame)] \ + -arrowcolor [list disabled $colors(-disabledfg)] ttk::style configure ComboboxPopdownFrame \ -relief solid -borderwidth 1 diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index b278e3f..808c365 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -110,8 +110,7 @@ namespace eval ttk::theme::clam { -fieldbackground [list {readonly focus} $colors(-selectbg) \ readonly $colors(-frame)] \ -foreground [list {readonly focus} $colors(-selectfg)] \ - ; - ttk::style map TCombobox -arrowcolor [list disabled $colors(-disabledfg)] + -arrowcolor [list disabled $colors(-disabledfg)] ttk::style configure ComboboxPopdownFrame \ -relief solid -borderwidth 1 diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index f38a4a2..56e2176 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -74,11 +74,11 @@ namespace eval ttk::theme::default { -relief sunken -fieldbackground white -padding 1 ttk::style map TEntry -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] - ttk::style map TCombobox -arrowcolor [list disabled $colors(-disabledfg)] ttk::style configure TCombobox -arrowsize 12 -padding 1 ttk::style map TCombobox -fieldbackground \ - [list readonly $colors(-frame) disabled $colors(-frame)] + [list readonly $colors(-frame) disabled $colors(-frame)] \ + -arrowcolor [list disabled $colors(-disabledfg)] ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0} ttk::style map TSpinbox -fieldbackground \ -- cgit v0.12 From 1a74e9de135efaea49d48f7974960bc6e8426949 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 10 Feb 2017 11:38:55 +0000 Subject: Fix [7d967c68a09e07e355358af40f36dd5dd84c7022|7d967c68a0] follow-up: Tk applications segmentation fault when ibus-daemon IME is restarted. Patch by Brad Lanam. --- generic/tkWindow.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/generic/tkWindow.c b/generic/tkWindow.c index e4d696b..690a841 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -475,9 +475,6 @@ GetScreen( dispPtr->cursorFont = None; dispPtr->warpWindow = NULL; dispPtr->multipleAtom = None; -#ifdef TK_USE_INPUT_METHODS - dispPtr->ximGeneration = 0; -#endif /*TK_USE_INPUT_METHODS*/ /* * By default we do want to collapse motion events in @@ -656,6 +653,7 @@ TkAllocWindow( winPtr->flags = 0; winPtr->handlerList = NULL; #ifdef TK_USE_INPUT_METHODS + winPtr->ximGeneration = 0; winPtr->inputContext = NULL; #endif /* TK_USE_INPUT_METHODS */ winPtr->tagPtr = NULL; -- cgit v0.12 -- cgit v0.12 From 8701bf597e98498ab4d757caa5a2bb9dd46a0554 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 6 Mar 2017 16:46:23 +0000 Subject: [6b3644a485] Fix -alpha applied to 16-bit color PNG. Thanks TheLemonMan. --- generic/tkImgPNG.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index c6e3029..6e64afa 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -2245,10 +2245,10 @@ ApplyAlpha( p += offset; if (16 == pngPtr->bitDepth) { - register int channel; + register unsigned int channel; while (p < endPtr) { - channel = (unsigned char) + channel = (unsigned int) (((p[0] << 8) | p[1]) * pngPtr->alpha); *p++ = (unsigned char) (channel >> 8); -- cgit v0.12 From 62ab7985dd7a7e82173c18ca3ff19ba49f152ed8 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 6 Mar 2017 23:23:11 +0000 Subject: Added documentation for the new keysyms --- doc/keysyms.n | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/keysyms.n b/doc/keysyms.n index bf81440..84214ff 100644 --- a/doc/keysyms.n +++ b/doc/keysyms.n @@ -918,6 +918,13 @@ Super_R 65516 0xffec Hyper_L 65517 0xffed Hyper_R 65518 0xffee Delete 65535 0xffff +XF86AudioLowerVolume 269025041 0x1008FF11 +XF86AudioMute 269025042 0x1008FF12 +XF86AudioRaiseVolume 269025043 0x1008FF13 +XF86AudioPlay 269025044 0x1008FF14 +XF86AudioStop 269025045 0x1008FF15 +XF86AudioPrev 269025046 0x1008FF16 +XF86AudioNext 269025047 0x1008FF17 .CE .SH "SEE ALSO" bind(n), event(n) -- cgit v0.12 From 72ea4ad7973b2bfe4b92f346dae82919e7d0ae35 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 7 Mar 2017 12:50:16 +0000 Subject: Remove "makefile.bc". Not update for many-many years, most likely it doesn't work any more and it doesn't seem to care anyone. --- .fossil-settings/crlf-glob | 1 - .fossil-settings/crnl-glob | 1 - .fossil-settings/encoding-glob | 1 - doc/menu.n | 2 +- macosx/Tk.xcode/project.pbxproj | 4 - macosx/Tk.xcodeproj/project.pbxproj | 4 - win/makefile.bc | 537 ------------------------------------ 7 files changed, 1 insertion(+), 549 deletions(-) delete mode 100644 win/makefile.bc diff --git a/.fossil-settings/crlf-glob b/.fossil-settings/crlf-glob index 7175730..d1fd9fc 100644 --- a/.fossil-settings/crlf-glob +++ b/.fossil-settings/crlf-glob @@ -1,5 +1,4 @@ win/buildall.vc.bat -win/makefile.bc win/makefile.vc win/mkd.bat win/rmd.bat diff --git a/.fossil-settings/crnl-glob b/.fossil-settings/crnl-glob index 7175730..d1fd9fc 100644 --- a/.fossil-settings/crnl-glob +++ b/.fossil-settings/crnl-glob @@ -1,5 +1,4 @@ win/buildall.vc.bat -win/makefile.bc win/makefile.vc win/mkd.bat win/rmd.bat diff --git a/.fossil-settings/encoding-glob b/.fossil-settings/encoding-glob index 7175730..d1fd9fc 100644 --- a/.fossil-settings/encoding-glob +++ b/.fossil-settings/encoding-glob @@ -1,5 +1,4 @@ win/buildall.vc.bat -win/makefile.bc win/makefile.vc win/mkd.bat win/rmd.bat diff --git a/doc/menu.n b/doc/menu.n index 9dd7ef4..5742e23 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -101,7 +101,7 @@ textual field is displayed to the right of the label. The accelerator typically describes a keystroke sequence that may be used in the application to cause the same result as invoking the menu entry. This is a display option, it does not actually set the corresponding -binding (which can be achieved using the \fBbind\fR command). +binding (which can be achieved using the \fBbind\fR command). The third field is an \fIindicator\fR. The indicator is present only for checkbutton or radiobutton entries. It indicates whether the entry is selected or not, and is displayed to the left of the entry's diff --git a/macosx/Tk.xcode/project.pbxproj b/macosx/Tk.xcode/project.pbxproj index 70c2472..cef835d 100644 --- a/macosx/Tk.xcode/project.pbxproj +++ b/macosx/Tk.xcode/project.pbxproj @@ -1212,7 +1212,6 @@ F966BC9508F27A3D005CB29B /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = ""; }; F966BC9608F27A3E005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; F966BC9708F27A3E005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; - F966BC9808F27A3E005CB29B /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = ""; }; F966BC9908F27A3E005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F966BC9A08F27A3E005CB29B /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = ""; }; F966BC9B08F27A3E005CB29B /* mkd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mkd.bat; sourceTree = ""; }; @@ -1987,7 +1986,6 @@ F96D447308F272BA004A47F5 /* coffbase.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = coffbase.txt; sourceTree = ""; }; F96D447408F272BA004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; F96D447508F272BA004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; - F96D447608F272BA004A47F5 /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = ""; }; F96D447708F272BA004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F96D447808F272BA004A47F5 /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = ""; }; F96D447908F272BA004A47F5 /* nmakehlp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nmakehlp.c; sourceTree = ""; }; @@ -2791,7 +2789,6 @@ F966BC9508F27A3D005CB29B /* buildall.vc.bat */, F966BC9608F27A3E005CB29B /* configure */, F966BC9708F27A3E005CB29B /* configure.in */, - F966BC9808F27A3E005CB29B /* makefile.bc */, F966BC9908F27A3E005CB29B /* Makefile.in */, F966BC9A08F27A3E005CB29B /* makefile.vc */, F966BC9B08F27A3E005CB29B /* mkd.bat */, @@ -3822,7 +3819,6 @@ F96D447308F272BA004A47F5 /* coffbase.txt */, F96D447408F272BA004A47F5 /* configure */, F96D447508F272BA004A47F5 /* configure.in */, - F96D447608F272BA004A47F5 /* makefile.bc */, F96D447708F272BA004A47F5 /* Makefile.in */, F96D447808F272BA004A47F5 /* makefile.vc */, F96D447908F272BA004A47F5 /* nmakehlp.c */, diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index dcfe9fb..e642185 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -1212,7 +1212,6 @@ F966BC9508F27A3D005CB29B /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = ""; }; F966BC9608F27A3E005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; F966BC9708F27A3E005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; - F966BC9808F27A3E005CB29B /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = ""; }; F966BC9908F27A3E005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F966BC9A08F27A3E005CB29B /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = ""; }; F966BC9B08F27A3E005CB29B /* mkd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mkd.bat; sourceTree = ""; }; @@ -1987,7 +1986,6 @@ F96D447308F272BA004A47F5 /* coffbase.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = coffbase.txt; sourceTree = ""; }; F96D447408F272BA004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; F96D447508F272BA004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; - F96D447608F272BA004A47F5 /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = ""; }; F96D447708F272BA004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F96D447808F272BA004A47F5 /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = ""; }; F96D447908F272BA004A47F5 /* nmakehlp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nmakehlp.c; sourceTree = ""; }; @@ -2791,7 +2789,6 @@ F966BC9508F27A3D005CB29B /* buildall.vc.bat */, F966BC9608F27A3E005CB29B /* configure */, F966BC9708F27A3E005CB29B /* configure.in */, - F966BC9808F27A3E005CB29B /* makefile.bc */, F966BC9908F27A3E005CB29B /* Makefile.in */, F966BC9A08F27A3E005CB29B /* makefile.vc */, F966BC9B08F27A3E005CB29B /* mkd.bat */, @@ -3822,7 +3819,6 @@ F96D447308F272BA004A47F5 /* coffbase.txt */, F96D447408F272BA004A47F5 /* configure */, F96D447508F272BA004A47F5 /* configure.in */, - F96D447608F272BA004A47F5 /* makefile.bc */, F96D447708F272BA004A47F5 /* Makefile.in */, F96D447808F272BA004A47F5 /* makefile.vc */, F96D447908F272BA004A47F5 /* nmakehlp.c */, diff --git a/win/makefile.bc b/win/makefile.bc deleted file mode 100644 index d98dfd7..0000000 --- a/win/makefile.bc +++ /dev/null @@ -1,537 +0,0 @@ -# -# Makefile for Borland C++ 5.5 (or C++ Builder 5), adapted from the makefile -# for Visual C++ that came with tk 8.3.3 -# -# Some "not so obvious" details in this makefile are preceded by a comment -# "maintenance hint", which tries to explain what's going on. Better to -# leave those in place. -# Helmut Giese, July 2002 -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# Copyright (c) 1995-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-2000 Ajuba Solutions. - -# Does not depend on the presence of any environment variables in -# order to compile tcl; all needed information is derived from -# location of the compiler directories. - -# -# Project directories -# -# ROOT = top of source tree -# -# TMPDIR = location where .obj files should be stored during build -# -# TOOLS32 = location of Borland development tools. -# -# TCLDIR = location of top of Tcl source hierarchy -# - -ROOT = .. -TCLDIR = ..\..\tcl8.4 -INSTALLDIR = D:\tmp\tcl - -# If you have C++ Builder 5 or the free Borland C++ 5.5 compiler -# adapt the following paths as appropriate for your system -TOOLS32 = d:\cbld5 -TOOLS32_rc = d:\cbld5 -#TOOLS32 = c:\bc55 -#TOOLS32_rc = c:\bc55 - -cc32 = "$(TOOLS32)\bin\bcc32.exe" -link32 = "$(TOOLS32)\bin\ilink32.exe" -lib32 = "$(TOOLS32)\bin\tlib.exe" -rc32 = "$(TOOLS32_rc)\bin\brcc32.exe" -include32 = -I"$(TOOLS32)\include;$(TOOLS32)\include\mfc" -libpath32 = -L"$(TOOLS32)\lib" - -# Uncomment the following line to compile with thread support -#THREADDEFINES = -DTCL_THREADS=1 - -# Allow definition of NDEBUG via command line -# Set NODEBUG to 0 to compile with symbols -!if !defined(NODEBUG) -NODEBUG = 1 -!endif - -# uncomment the following two lines to compile with TCL_MEM_DEBUG -#DEBUGDEFINES =-DTCL_MEM_DEBUG - -###################################################################### -# Do not modify below this line -###################################################################### - -TCLNAMEPREFIX = tcl -TKNAMEPREFIX = tk -WISHNAMEPREFIX = wish -VERSION = 84 -DOTVERSION = 8.4 - -TCLSTUBPREFIX = $(TCLNAMEPREFIX)stub -TKSTUBPREFIX = $(TKNAMEPREFIX)stub - - -BINROOT = . -!IF "$(NODEBUG)" == "1" -TMPDIRNAME = Release -DBGX = -!ELSE -TMPDIRNAME = Debug -DBGX = -#DBGX = d -!ENDIF -TMPDIR = $(BINROOT)\$(TMPDIRNAME) -OUTDIRNAME = $(TMPDIRNAME) -OUTDIR = $(TMPDIR) - -TCLLIB = $(TCLNAMEPREFIX)$(VERSION)$(DBGX).lib -TCLPLUGINLIB = $(TCLNAMEPREFIX)$(VERSION)p.lib -TCLSTUBLIB = $(TCLSTUBPREFIX)$(VERSION)$(DBGX).lib -TKDLLNAME = $(TKNAMEPREFIX)$(VERSION)$(DBGX).dll -TKDLL = $(OUTDIR)\$(TKDLLNAME) -TKLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)$(DBGX).lib -TKSTUBLIBNAME = $(TKSTUBPREFIX)$(VERSION)$(DBGX).lib -TKSTUBLIB = $(OUTDIR)\$(TKSTUBLIBNAME) -TKPLUGINDLLNAME = $(TKNAMEPREFIX)$(VERSION)p$(DBG).dll -TKPLUGINDLL = $(OUTDIR)\$(TKPLUGINDLLNAME) -TKPLUGINLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)p$(DBGX).lib - -WISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe -WISHC = $(OUTDIR)\$(WISHNAMEPREFIX)c$(VERSION)$(DBGX).exe -WISHP = $(OUTDIR)\$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe -TKTEST = $(OUTDIR)\$(TKNAMEPREFIX)test.exe -CAT32 = $(TMPDIR)\cat32.exe - -BIN_INSTALL_DIR = $(INSTALLDIR)\bin -INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include -LIB_INSTALL_DIR = $(INSTALLDIR)\lib -SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)\tk$(DOTVERSION) - -WISHOBJS = \ - $(TMPDIR)\winMain.obj - -TKTESTOBJS = \ - $(TMPDIR)\tkTest.obj \ - $(TMPDIR)\tkSquare.obj \ - $(TMPDIR)\testMain.obj \ - $(TMPDIR)\tkOldTest.obj \ - $(TMPDIR)\tkWinTest.obj \ - $(TCLLIBDIR)\tclThreadTest.obj - -XLIBOBJS = \ - $(TMPDIR)\xcolors.obj \ - $(TMPDIR)\xdraw.obj \ - $(TMPDIR)\xgc.obj \ - $(TMPDIR)\ximage.obj \ - $(TMPDIR)\xutil.obj - -TKOBJS = \ - $(TMPDIR)\tkConsole.obj \ - $(TMPDIR)\tkUnixMenubu.obj \ - $(TMPDIR)\tkUnixScale.obj \ - $(XLIBOBJS) \ - $(TMPDIR)\tkWin3d.obj \ - $(TMPDIR)\tkWin32Dll.obj \ - $(TMPDIR)\tkWinButton.obj \ - $(TMPDIR)\tkWinClipboard.obj \ - $(TMPDIR)\tkWinColor.obj \ - $(TMPDIR)\tkWinConfig.obj \ - $(TMPDIR)\tkWinCursor.obj \ - $(TMPDIR)\tkWinDialog.obj \ - $(TMPDIR)\tkWinDraw.obj \ - $(TMPDIR)\tkWinEmbed.obj \ - $(TMPDIR)\tkWinFont.obj \ - $(TMPDIR)\tkWinImage.obj \ - $(TMPDIR)\tkWinInit.obj \ - $(TMPDIR)\tkWinKey.obj \ - $(TMPDIR)\tkWinMenu.obj \ - $(TMPDIR)\tkWinPixmap.obj \ - $(TMPDIR)\tkWinPointer.obj \ - $(TMPDIR)\tkWinRegion.obj \ - $(TMPDIR)\tkWinScrlbr.obj \ - $(TMPDIR)\tkWinSend.obj \ - $(TMPDIR)\tkWinWindow.obj \ - $(TMPDIR)\tkWinWm.obj \ - $(TMPDIR)\tkWinX.obj \ - $(TMPDIR)\stubs.obj \ - $(TMPDIR)\tk3d.obj \ - $(TMPDIR)\tkArgv.obj \ - $(TMPDIR)\tkAtom.obj \ - $(TMPDIR)\tkBind.obj \ - $(TMPDIR)\tkBitmap.obj \ - $(TMPDIR)\tkBusy.obj \ - $(TMPDIR)\tkButton.obj \ - $(TMPDIR)\tkCanvArc.obj \ - $(TMPDIR)\tkCanvBmap.obj \ - $(TMPDIR)\tkCanvImg.obj \ - $(TMPDIR)\tkCanvLine.obj \ - $(TMPDIR)\tkCanvPoly.obj \ - $(TMPDIR)\tkCanvPs.obj \ - $(TMPDIR)\tkCanvText.obj \ - $(TMPDIR)\tkCanvUtil.obj \ - $(TMPDIR)\tkCanvWind.obj \ - $(TMPDIR)\tkCanvas.obj \ - $(TMPDIR)\tkClipboard.obj \ - $(TMPDIR)\tkCmds.obj \ - $(TMPDIR)\tkColor.obj \ - $(TMPDIR)\tkConfig.obj \ - $(TMPDIR)\tkCursor.obj \ - $(TMPDIR)\tkEntry.obj \ - $(TMPDIR)\tkError.obj \ - $(TMPDIR)\tkEvent.obj \ - $(TMPDIR)\tkFileFilter.obj \ - $(TMPDIR)\tkFocus.obj \ - $(TMPDIR)\tkFont.obj \ - $(TMPDIR)\tkFrame.obj \ - $(TMPDIR)\tkGC.obj \ - $(TMPDIR)\tkGeometry.obj \ - $(TMPDIR)\tkGet.obj \ - $(TMPDIR)\tkGrab.obj \ - $(TMPDIR)\tkGrid.obj \ - $(TMPDIR)\tkImage.obj \ - $(TMPDIR)\tkImgBmap.obj \ - $(TMPDIR)\tkImgGIF.obj \ - $(TMPDIR)\tkImgPPM.obj \ - $(TMPDIR)\tkImgPhoto.obj \ - $(TMPDIR)\tkImgPhInstance.obj \ - $(TMPDIR)\tkImgUtil.obj \ - $(TMPDIR)\tkListbox.obj \ - $(TMPDIR)\tkMacWinMenu.obj \ - $(TMPDIR)\tkMain.obj \ - $(TMPDIR)\tkMenu.obj \ - $(TMPDIR)\tkMenubutton.obj \ - $(TMPDIR)\tkMenuDraw.obj \ - $(TMPDIR)\tkMessage.obj \ - $(TMP_DIR)\tkPanedWindow.obj \ - $(TMPDIR)\tkObj.obj \ - $(TMPDIR)\tkOldConfig.obj \ - $(TMPDIR)\tkOption.obj \ - $(TMPDIR)\tkPack.obj \ - $(TMPDIR)\tkPlace.obj \ - $(TMPDIR)\tkPointer.obj \ - $(TMPDIR)\tkRectOval.obj \ - $(TMPDIR)\tkScale.obj \ - $(TMPDIR)\tkScrollbar.obj \ - $(TMPDIR)\tkSelect.obj \ - $(TMPDIR)\tkText.obj \ - $(TMPDIR)\tkTextBTree.obj \ - $(TMPDIR)\tkTextDisp.obj \ - $(TMPDIR)\tkTextImage.obj \ - $(TMPDIR)\tkTextIndex.obj \ - $(TMPDIR)\tkTextMark.obj \ - $(TMPDIR)\tkTextTag.obj \ - $(TMPDIR)\tkTextWind.obj \ - $(TMPDIR)\tkTrig.obj \ - $(TMPDIR)\tkUtil.obj \ - $(TMPDIR)\tkVisual.obj \ - $(TMPDIR)\tkStubInit.obj \ - $(TMPDIR)\tkWindow.obj - -# Maintenance hint: Please have multiple members of TKSTUBOBJS be separated -# by exactly one ' ' (see below the rule for making TKSTUBLIB) -TKSTUBOBJS = $(TMPDIR)\tkStubLib.obj - -WINDIR = $(ROOT)\win -GENERICDIR = $(ROOT)\generic -XLIBDIR = $(ROOT)\xlib -BITMAPDIR = $(ROOT)\bitmaps -TCLLIBDIR = $(TCLDIR)\win\$(OUTDIRNAME) -RCDIR = $(WINDIR)\rc - -TK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \ - -I$(TCLDIR)\generic -I$(TCLDIR)\win - -TK_DEFINES = -D_WIN32 $(DEBUGDEFINES) $(THREADDEFINES) SUPPORT_CONFIG_EMBEDDED - -###################################################################### -# Compile flags -###################################################################### - -!IF "$(NODEBUG)" == "1" -# these macros cause maximum optimization and no symbols -cdebug = -v- -vi- -O2 -D_DEBUG -!ELSE -# these macros enable debugging -cdebug = -k -Od -r- -v -vi- -y -!ENDIF - -SYSDEFINES = _MT;NO_STRICT;_NO_VCL - -# declarations common to all compiler options -cbase = -3 -a4 -c -g0 -tWM -Ve -Vx -X- -WARNINGS = -w-rch -w-pch -w-par -w-dup -w-pro -w-dpu - -ccons = -tWC - -CFLAGS = $(cdebug) $(cbase) $(WARNINGS) -D$(SYSDEFINES) - -CON_CFLAGS = $(CFLAGS) $(TK_DEFINES) $(include32) $(ccons) -WISH_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) -TK_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) \ - -DUSE_TCL_STUBS - -###################################################################### -# Link flags -###################################################################### - -!IF "$(NODEBUG)" == "1" -ldebug = -!ELSE -ldebug = -v -!ENDIF - -# declarations common to all linker options -LNFLAGS = -D"" -Gn -I$(TMPDIR) -x $(ldebug) $(libpath32) -# -Gi: create lib file (is -Gl in doc) -# -aa: Windows app, -ap: Windows console app -LNFLAGS_DLL = -ap -Gi -Tpd -LNFLAGS_CONS = -ap -Tpe -LNFLAGS_GUI = -aa -Tpe - -LNLIBS = import32 cw32mt - - -###################################################################### -# Project specific targets -###################################################################### - -all: setup $(WISH) $(CAT32) -install: install-binaries install-libraries -plugin: setup $(TKPLUGINDLL) $(WISHP) -tktest: setup $(TKTEST) $(CAT32) - -# Maintenance hint: We want to set environment variables before calling tktest. -# If we do this in the form of normal commands, they will not persist up to -# the call of tktest. Therfore we put all commands wanted into a batch file. -# The normal way of using 'echo >x.bat' and 'echo >>x.bat' does not work here -# because we cannot write '... > tktest.txt' this way. Hence this advanced -# form of loop hopping: -# - Have MAKE produce a temporary file with the content we want. -# - Use it as input to the COPY command to produce a batch file. -# - Run the batch file and be happy. -# -test: setup $(TKTEST) $(TKLIB) $(CAT32) - copy &&! - set TCL_LIBRARY=$(TCLDIR)/library - set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) - $(TKTEST) $(ROOT)/tests/all.tcl > tktest.txt -! _test.bat - _test.bat -# del _test.bat - -runtest: setup $(TKTEST) $(TKLIB) $(CAT32) - echo set TCL_LIBRARY=$(TCLDIR)/library > _test2.bat - echo set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) >> _test2.bat - echo $(TKTEST) >> _test2.bat - _test2.bat -# del _test2.bat - -console-wish : all $(WISHC) - -stubs: - $(TCLDIR)\win\$(TMPDIRNAME)\tclsh$(VERSION)$(DBGX) \ - $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ - $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls - -setup: - @mkd $(TMPDIR) - @mkd $(OUTDIR) - -install-binaries: - @mkd "$(BIN_INSTALL_DIR)" - copy $(TKDLL) "$(BIN_INSTALL_DIR)" - copy $(WISH) "$(BIN_INSTALL_DIR)" - @mkd "$(LIB_INSTALL_DIR)" - copy $(TKLIB) "$(LIB_INSTALL_DIR)" - -install-libraries: - @mkd "$(INCLUDE_INSTALL_DIR)" - @mkd "$(INCLUDE_INSTALL_DIR)\X11" - copy "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)" - copy "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)" - copy "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)" - copy "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)" - xcopy "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11" - @mkd "$(SCRIPT_INSTALL_DIR)" - @mkd "$(SCRIPT_INSTALL_DIR)\images" - @mkd "$(SCRIPT_INSTALL_DIR)\demos" - @mkd "$(SCRIPT_INSTALL_DIR)\demos\images" - @mkd "$(SCRIPT_INSTALL_DIR)\msgs" - xcopy "$(ROOT)\library" "$(SCRIPT_INSTALL_DIR)" - xcopy "$(ROOT)\library\images" "$(SCRIPT_INSTALL_DIR)\images" - xcopy "$(ROOT)\library\demos" "$(SCRIPT_INSTALL_DIR)\demos" - xcopy "$(ROOT)\library\demos\images" "$(SCRIPT_INSTALL_DIR)\demos\images" - xcopy "$(ROOT)\library\msgs" "$(SCRIPT_INSTALL_DIR)\msgs" - -$(TKLIB): $(TKDLL) $(TKSTUBLIB) - -# Maintenance hint: The macro puts a '+-' before the first member of -# TKSTUBOBJS, than replaces any ' ' with ' +-' - together putting '+-' in -# front of any member of TKSTUBOBJS (provided, they are separated in their -# defintion by just one space). -# -# The first time you *make* this target, you will get a warning -# tkStubLib not found in library -# This is (probably) because of the '-' option, telling TLIB to remove -# 'tkStubLib' when it does not yet exist. Forcing a re-make when it already -# exists avoids this warning. -# -$(TKSTUBLIB): $(TKSTUBOBJS) - $(lib32) $@ +-$(TKSTUBOBJS: = +-) - -# $(lib32) $@ @&&! -#+-$(TKSTUBOBJS: = &^ -#+-) -#! - -$(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res - $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_DLL) $(TOOLS32)\lib\c0d32 @&&! - $(TKOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLSTUBLIB),, $(TMPDIR)\tk.res -! - -$(TKPLUGINLIB): $(TKPLUGINDLL) - -#$(TKPLUGINDLL): $(TKOBJS) $(TMPDIR)\tk.res -# $(link32) $(ldebug) $(dlllflags) \ -# -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLPLUGINLIB) \ -# $(guilibsdll) @<< -# $(TKOBJS) -#<< - -$(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! - $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res -! - -$(WISHC): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 @&&! - $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res -! - -$(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ - $(guilibsdll) $(TCLLIBDIR)\$(TCLPLUGINLIB) \ - $(TKPLUGINLIB) $(WISHOBJS) - -$(TKTEST): $(TKTESTOBJS) $(TKLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! - $(TKTESTOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res -! -# $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ -# $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(TKTESTOBJS) - -#$(CAT32): $(TCLDIR)\win\cat.c -# $(cc32) $(CON_CFLAGS) -o$(TMPDIR)\cat.obj $? -# $(link32) $(conlflags) -out:$@ -stack:16384 $(TMPDIR)\cat.obj $(conlibs) - -$(CAT32): $(TCLDIR)\win\cat.c - $(cc32) $(CONS_CFLAGS) -o$(TMPDIR)\cat.obj $? - $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 \ - $(TMPDIR)\cat.obj, $@, -x, $(LNLIBS),, - -# -# Regenerate the stubs files. -# - -genstubs: - tclsh$(VERSION) $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ - $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls - -# -# Special case object file targets -# - -$(TMPDIR)\testMain.obj: $(WINDIR)\winMain.c - $(cc32) $(WISH_CFLAGS) -DTK_TEST -o$@ $? - -$(TMPDIR)\tkTest.obj: $(GENERICDIR)\tkTest.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\winMain.obj: $(WINDIR)\winMain.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c - $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -o$@ $? - -# -# Implicit rules -# - -{$(XLIBDIR)}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(GENERICDIR)}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(WINDIR)}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(ROOT)\unix}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(RCDIR)}.rc{$(TMPDIR)}.res: - $(rc32) -I"$(GENERICDIR)" -I"$(TOOLS32)\include" -I"$(TCLDIR)\generic" \ - -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< - -clean: - -@del $(OUTDIR)\*.exp - -@del $(OUTDIR)\*.lib - -@del $(OUTDIR)\*.dll - -@del $(OUTDIR)\*.exe - -@del $(OUTDIR)\*.pdb - -@del $(TMPDIR)\*.pch - -@del $(TMPDIR)\*.obj - -@del $(TMPDIR)\*.res - -@del $(TMPDIR)\*.exe - -@rmd $(OUTDIR) - -@rmd $(TMPDIR) - -# dependencies - -$(TMPDIR)\tk.res: \ - $(RCDIR)\buttons.bmp \ - $(RCDIR)\cursor*.cur \ - $(RCDIR)\tk.ico - -$(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h -$(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h - -$(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h - -$(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h -$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h -$(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h -$(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h - - -- cgit v0.12 From df6fa8964b35117316f9a0195c2e80be5b5e032b Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 10 Mar 2017 22:12:09 +0000 Subject: Fix [77527326e5]: ttk artifacts on Ubuntu. Patch from Csaba Nemethi. --- generic/ttk/ttkDefaultTheme.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 81f8126..4a06192 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -209,6 +209,9 @@ void TtkFillArrow( ArrowPoints(b, dir, points); XFillPolygon(display, d, gc, points, 3, Convex, CoordModeOrigin); XDrawLines(display, d, gc, points, 4, CoordModeOrigin); + + /* Work around bug [77527326e5] - ttk artifacts on Ubuntu */ + XDrawPoint(display, d, gc, points[2].x, points[2].y); } /*public*/ @@ -218,6 +221,9 @@ void TtkDrawArrow( XPoint points[4]; ArrowPoints(b, dir, points); XDrawLines(display, d, gc, points, 4, CoordModeOrigin); + + /* Work around bug [77527326e5] - ttk artifacts on Ubuntu */ + XDrawPoint(display, d, gc, points[2].x, points[2].y); } /* -- cgit v0.12 From 046813684f5fcdd4764db7fc53922266d6eb1586 Mon Sep 17 00:00:00 2001 From: avl Date: Tue, 14 Mar 2017 01:13:36 +0000 Subject: added a remark about some keysyms being valid across platforms... --- doc/keysyms.n | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/keysyms.n b/doc/keysyms.n index 84214ff..512c1a6 100644 --- a/doc/keysyms.n +++ b/doc/keysyms.n @@ -15,7 +15,9 @@ Tk recognizes many keysyms when specifying key bindings (e.g., .QW "\fBbind\fR \fB. \fR" ). The following list enumerates the keysyms that will be recognized by Tk. Note that not all keysyms will -be valid on all platforms. For example, on Unix systems, the presence +be valid on all platforms, and some keysyms are also available on +platforms that have a different native name for that key. +For example, on Unix systems, the presence of a particular keysym is dependant on the configuration of the keyboard modifier map. This list shows keysyms along with their decimal and hexadecimal values. -- cgit v0.12 From f544ca9012f54c92d4f16cfe372e86e384d9a7c1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 22 Mar 2017 10:26:20 +0000 Subject: Fix test-case safe-1.2. Failure introduced by commit [https://core.tcl.tk/tcl/info/b82ff15ca653495e|b82ff15ca6] in Tcl --- tests/safe.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/safe.test b/tests/safe.test index 69a67ba..475d938 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -15,7 +15,7 @@ namespace import -force tcltest::test # Can't find a usable tk.tcl in the following directories: # {$p(:26:)} -# +# # $p(:26:)/tk.tcl: script error # script error # invoked from within @@ -23,8 +23,8 @@ namespace import -force tcltest::test # ("uplevel" body line 1) # invoked from within # "uplevel #0 [list source $file]" -# -# +# +# # This probably means that tk wasn't installed properly. ## it indicates that something went wrong sourcing tk.tcl. @@ -33,7 +33,7 @@ namespace import -force tcltest::test # The set of hidden commands is platform dependent: -set hidden_cmds {bell cd clipboard encoding exec exit fconfigure glob grab load menu open pwd selection socket source toplevel unload wm} +set hidden_cmds {bell cd clipboard encoding exec exit fconfigure glob grab load menu open pwd selection socket source tcl:encoding:dirs toplevel unload wm} lappend hidden_cmds {*}[apply {{} { foreach cmd { atime attributes copy delete dirname executable exists extension -- cgit v0.12