Skip to content

Commit

Permalink
merge trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
fvogelnew1 committed Mar 15, 2024
2 parents 1dd8357 + b0e011f commit 85a6eab
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 142 deletions.
4 changes: 1 addition & 3 deletions doc/ttk_panedwindow.n
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ Returns the new position of sash number \fIindex\fR.
.SH "VIRTUAL EVENTS"
.PP
The panedwindow widget generates an \fB<<EnteredChild>>\fR virtual event on
LeaveNotify/NotifyInferior events, because Tk does not execute binding scripts
for <Leave> events when the pointer crosses from a parent to a child. The
panedwindow widget needs to know when that happens.
LeaveNotify/NotifyInferior events.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::panedwindow\fP is \fBTPanedwindow\fP. The
Expand Down
14 changes: 11 additions & 3 deletions generic/tkCanvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -5275,9 +5275,17 @@ PickCurrentItem(
event.type = LeaveNotify;

/*
* If the event's detail happens to be NotifyInferior the binding
* mechanism will discard the event. To be consistent, always use
* NotifyAncestor.
* Behaviour before ticket #47d4f29159:
* If the event's detail happens to be NotifyInferior the binding
* mechanism will discard the event. To be consistent, always use
* NotifyAncestor.
*
* Behaviour after ticket #47d4f29159:
* The binding mechanism doesn't discard events with detail field
* NotifyInferior anymore. It would be best to base the detail
* field on the ancestry relationship between the old and new
* canvas items. For the time being, retain the choice from before
* ticket #47d4f29159, which doesn't harm.
*/

event.xcrossing.detail = NotifyAncestor;
Expand Down
49 changes: 1 addition & 48 deletions generic/tkPkgConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,9 @@
/* Note, the definitions in this module are influenced by the following C
* preprocessor macros:
*
* OSCMa = shortcut for "old style configuration macro activates"
* NSCMdt = shortcut for "new style configuration macro declares that"
*
* - TCL_THREADS OSCMa compilation as threaded.
* - TCL_MEM_DEBUG OSCMa memory debugging.
*
* - TCL_CFG_DO64BIT NSCMdt tk is compiled for a 64bit system.
* - NDEBUG NSCMdt tk is compiled with symbol info off.
* - TCL_CFG_OPTIMIZED NSCMdt tk is compiled with cc optimizations on
* - TCL_CFG_PROFILED NSCMdt tk is compiled with profiling info.
*
* - _WIN32 || __CYGWIN__ The value for the fontsytem key will be
* MAC_OSX_TK chosen based on these macros/defines.
* HAVE_XFT NSCMdt xft font support was requested.
* HAVE_XFT declares that xft font support was requested.
*
* - CFG_RUNTIME_* Paths to various stuff at runtime.
* - CFG_INSTALL_* Paths to various stuff at installation time.
Expand All @@ -48,42 +37,6 @@
* configuration information.
*/

#ifdef TCL_THREADS
# define CFG_THREADED "1"
#else
# define CFG_THREADED "0"
#endif

#ifdef TCL_MEM_DEBUG
# define CFG_MEMDEBUG "1"
#else
# define CFG_MEMDEBUG "0"
#endif

#ifdef TCL_CFG_DO64BIT
# define CFG_64 "1"
#else
# define CFG_64 "0"
#endif

#ifndef NDEBUG
# define CFG_DEBUG "1"
#else
# define CFG_DEBUG "0"
#endif

#ifdef TCL_CFG_OPTIMIZED
# define CFG_OPTIMIZED "1"
#else
# define CFG_OPTIMIZED "0"
#endif

#ifdef TCL_CFG_PROFILED
# define CFG_PROFILED "1"
#else
# define CFG_PROFILED "0"
#endif

#if defined(_WIN32)
# define CFG_FONTSYSTEM "gdi"
#elif defined(MAC_OSX_TK)
Expand Down
14 changes: 11 additions & 3 deletions generic/tkTextTag.c
Original file line number Diff line number Diff line change
Expand Up @@ -3249,9 +3249,17 @@ TkTextPickCurrent(
* Invoke the binding system with a EnterNotify event for all of the tags
* that have just appeared.
*
* Always use a detail of NotifyAncestor. Besides being
* consistent, this avoids problems where the binding code will
* discard NotifyInferior events.
* Behaviour before ticket #47d4f29159:
* Always use a detail of NotifyAncestor. Besides being
* consistent, this avoids problems where the binding code will
* discard NotifyInferior events.
*
* Behaviour after ticket #47d4f29159:
* The binding mechanism doesn't discard events with detail field
* NotifyInferior anymore. It would be best to base the detail
* field on the ancestry relationship between the old and new
* tags. For the time being, retain the choice from before
* ticket #47d4f29159, which doesn't harm.
*/

event = textPtr->pickEvent;
Expand Down
4 changes: 2 additions & 2 deletions generic/tkWindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,15 +888,15 @@ TkCreateMainWindow(
#if TCL_MAJOR_VERSION > 8
mainPtr->tclUpdateObjProc2 = NULL;
#endif
if (Tcl_LinkVar(interp, "tk_strictMotif", (char *) &mainPtr->strictMotif,
if (Tcl_LinkVar(interp, "tk_strictMotif", &mainPtr->strictMotif,
TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
if (Tcl_CreateNamespace(interp, "::tk", NULL, NULL) == NULL) {
Tcl_ResetResult(interp);
}
if (Tcl_LinkVar(interp, "::tk::AlwaysShowSelection",
(char *) &mainPtr->alwaysShowSelection,
&mainPtr->alwaysShowSelection,
TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
Expand Down
14 changes: 8 additions & 6 deletions generic/ttk/ttkPanedwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,16 @@ static const Ttk_ManagerSpec PanedManagerSpec = {
/*------------------------------------------------------------------------
* +++ Event handler.
*
* <<NOTE-PW-LEAVE-NOTIFYINFERIOR>>
* Tk does not execute binding scripts for <Leave> events when
* the pointer crosses from a parent to a child. This widget
* needs to know when that happens, though, so it can reset
* the cursor.
*
* This event handler generates an <<EnteredChild>> virtual event
* on LeaveNotify/NotifyInferior.
* This was originally introduced because Tk used to discard events with
* detail field NotifyInferior. The <<EnteredChild>> event was then used
* to reset the cursor when the pointer crosses from a parent to a child.
* Since ticket #47d4f29159, LeaveNotify/NotifyInferior are no longer
* discarded: the <Leave> event will trigger even with NotifyInferior
* detail field. The generated <<EnteredChild>> is nevertheless kept for
* backwards compatibility purpose since it is publicly documented,
* meaning that someone could bind to it.
*/

static const unsigned PanedEventMask = LeaveWindowMask;
Expand Down
2 changes: 0 additions & 2 deletions generic/ttk/ttkWidget.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ DestroyWidget(WidgetCore *corePtr)
* For Destroy events, handle the cleanup process.
*
* For Focus events, set/clear the focus bit in the state field.
* It turns out this is impossible to do correctly in a binding script,
* because Tk filters out focus events with detail == NotifyInferior.
*
* For Deactivate/Activate pseudo-events, set/clear the background state
* flag.
Expand Down
2 changes: 0 additions & 2 deletions library/ttk/panedwindow.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ bind TPanedwindow <ButtonRelease-1> { ttk::panedwindow::Release %W %x %y }
bind TPanedwindow <Motion> { ttk::panedwindow::SetCursor %W %x %y }
bind TPanedwindow <Enter> { ttk::panedwindow::SetCursor %W %x %y }
bind TPanedwindow <Leave> { ttk::panedwindow::ResetCursor %W }
# See <<NOTE-PW-LEAVE-NOTIFYINFERIOR>>
bind TPanedwindow <<EnteredChild>> { ttk::panedwindow::ResetCursor %W }

## Sash movement:
#
Expand Down
6 changes: 3 additions & 3 deletions macosx/tkMacOSXDraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ TkMacOSXInitCGDrawing(
}

if (Tcl_LinkVar(interp, "::tk::mac::CGAntialiasLimit",
(char *)&cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) {
&cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) {
Tcl_ResetResult(interp);
}
cgAntiAliasLimit = limit;
Expand All @@ -96,11 +96,11 @@ TkMacOSXInitCGDrawing(
*/

if (Tcl_LinkVar(interp, "::tk::mac::useThemedToplevel",
(char *)&useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) {
&useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
if (Tcl_LinkVar(interp, "::tk::mac::useThemedFrame",
(char *)&useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) {
&useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
transparentColor = TkMacOSXClearPixel();
Expand Down
86 changes: 44 additions & 42 deletions macosx/tkMacOSXFont.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,48 +478,49 @@ startOfClusterObjCmd(
{
TKNSString *S;
const char *stringArg;
Tcl_Size numBytes, index;
Tcl_Size len, idx;
if ((unsigned)(objc - 3) > 1) {
Tcl_WrongNumArgs(interp, 1 , objv, "str start ?locale?");
return TCL_ERROR;
}
stringArg = Tcl_GetStringFromObj(objv[1], &numBytes);
stringArg = Tcl_GetStringFromObj(objv[1], &len);
if (stringArg == NULL) {
return TCL_ERROR;
}
Tcl_Size ulen = Tcl_GetCharLength(objv[1]);
S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:numBytes];
if (TkGetIntForIndex(objv[2], ulen - 1, 0, &index) != TCL_OK) {
S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:len];
len = [S length];
if (TkGetIntForIndex(objv[2], ulen - 1, 0, &idx) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"",
Tcl_GetString(objv[2])));
Tcl_SetErrorCode(interp, "TK", "VALUE", "INDEX", NULL);
return TCL_ERROR;
}
if (index > 0 && (Tcl_Size)[S length] != ulen) {
if (idx > 0 && len != ulen) {
/* The string contains codepoints > \uFFFF. Determine UTF-16 index */
Tcl_Size newIdx = 0;
for (Tcl_Size i = 0; i < index; i++) {
newIdx += 1 + (((newIdx < (Tcl_Size)[S length]-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00));
for (Tcl_Size i = 0; i < idx; i++) {
newIdx += 1 + (((newIdx < len-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00));
}
index = newIdx;
idx = newIdx;
}
if (index >= 0) {
if (index >= (Tcl_Size)[S length]) {
index = (Tcl_Size)[S length];
if (idx >= 0) {
if (idx >= len) {
idx = len;
} else {
NSRange range = [S rangeOfComposedCharacterSequenceAtIndex:index];
index = range.location;
NSRange range = [S rangeOfComposedCharacterSequenceAtIndex:idx];
idx = range.location;
}
if (index > 0 && (Tcl_Size)[S length] != ulen) {
/* The string contains codepoints > \uFFFF. Determine UTF-32 index */
Tcl_Size newIdx = 1;
for (Tcl_Size i = 1; i < index; i++) {
if (idx > 0 && len != ulen) {
/* The string contains codepoints > \uFFFF. Determine UTF-32 index */
Tcl_Size newIdx = 1;
for (Tcl_Size i = 1; i < idx; i++) {
if ((([S characterAtIndex:i-1]&0xFC00) != 0xD800) || (([S characterAtIndex:i]&0xFC00) != 0xDC00)) newIdx++;
}
idx = newIdx;
}
index = newIdx;
}
Tcl_SetObjResult(interp, TkNewIndexObj(index));
Tcl_SetObjResult(interp, TkNewIndexObj(idx));
}
return TCL_OK;
}
Expand All @@ -533,49 +534,50 @@ endOfClusterObjCmd(
{
TKNSString *S;
char *stringArg;
Tcl_Size index, numBytes;
Tcl_Size idx, len;

if ((unsigned)(objc - 3) > 1) {
Tcl_WrongNumArgs(interp, 1 , objv, "str start ?locale?");
return TCL_ERROR;
}
stringArg = Tcl_GetStringFromObj(objv[1], &numBytes);
stringArg = Tcl_GetStringFromObj(objv[1], &len);
if (stringArg == NULL) {
return TCL_ERROR;
}
Tcl_Size ulen = Tcl_GetCharLength(objv[1]);
S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:numBytes];
if (TkGetIntForIndex(objv[2], ulen - 1, 0, &index) != TCL_OK) {
S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:len];
len = [S length];
if (TkGetIntForIndex(objv[2], ulen - 1, 0, &idx) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"",
Tcl_GetString(objv[2])));
Tcl_SetErrorCode(interp, "TK", "VALUE", "INDEX", NULL);
return TCL_ERROR;
}
if (index > 0 && (Tcl_Size)[S length] != ulen) {
if (idx > 0 && len != ulen) {
/* The string contains codepoints > \uFFFF. Determine UTF-16 index */
Tcl_Size newIdx = 0;
for (Tcl_Size i = 0; i < index; i++) {
newIdx += 1 + (((newIdx < (Tcl_Size)[S length]-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00));
for (Tcl_Size i = 0; i < idx; i++) {
newIdx += 1 + (((newIdx < len-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00));
}
index = newIdx;
idx = newIdx;
}
if ((size_t)index + 1 <= [S length]) {
if (index < 0) {
index = 0;
if (idx + 1 <= len) {
if (idx < 0) {
idx = 0;
} else {
NSRange range = [S rangeOfComposedCharacterSequenceAtIndex:index];
index = range.location + range.length;
}
if (index > 0 && (Tcl_Size)[S length] != ulen) {
/* The string contains codepoints > \uFFFF. Determine UTF-32 index */
Tcl_Size newIdx = 1;
for (Tcl_Size i = 1; i < index; i++) {
NSRange range = [S rangeOfComposedCharacterSequenceAtIndex:idx];
idx = range.location + range.length;
if (idx > 0 && len != ulen) {
/* The string contains codepoints > \uFFFF. Determine UTF-32 index */
Tcl_Size newIdx = 1;
for (Tcl_Size i = 1; i < idx; i++) {
if ((([S characterAtIndex:i-1]&0xFC00) != 0xD800) || (([S characterAtIndex:i]&0xFC00) != 0xDC00)) newIdx++;
}
idx = newIdx;
}
}
index = newIdx;
}
Tcl_SetObjResult(interp, TkNewIndexObj(index));
Tcl_SetObjResult(interp, TkNewIndexObj(idx));
}
return TCL_OK;
}
Expand Down Expand Up @@ -1561,7 +1563,7 @@ TkMacOSXUseAntialiasedText(
Tcl_ResetResult(interp);
}
if (Tcl_LinkVar(interp, "::tk::mac::antialiasedtext",
(char *) &antialiasedTextEnabled,
&antialiasedTextEnabled,
TCL_LINK_INT) != TCL_OK) {
Tcl_ResetResult(interp);
}
Expand Down
14 changes: 5 additions & 9 deletions unix/configure
Original file line number Diff line number Diff line change
Expand Up @@ -5219,16 +5219,12 @@ fi

case $system in
DragonFly-*|FreeBSD-*)
if test "${TCL_THREADS}" = "1"
then :

# The -pthread needs to go in the LDFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
fi
# The -pthread needs to go in the LDFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
;;
esac
esac

if test $doRpath = yes
then :
Expand Down
11 changes: 5 additions & 6 deletions unix/tcl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1276,13 +1276,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
case $system in
DragonFly-*|FreeBSD-*)
AS_IF([test "${TCL_THREADS}" = "1"], [
# The -pthread needs to go in the LDFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
# The -pthread needs to go in the LDFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
;;
esac
esac
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
Expand Down
Loading

0 comments on commit 85a6eab

Please sign in to comment.