Check-in [c1fde526f9]
Not logged in

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

Overview
Comment:merge with trunk
Timelines: family | ancestors | descendants | both | wtf-8-experiment
Files: files | file ages | folders
SHA1: c1fde526f9698db4ad27d3b5186a420a9596e79d
User & Date: chw 2019-11-07 06:17:53
Context
2019-11-07
15:28
merge with trunk check-in: 52620b1658 user: chw tags: wtf-8-experiment
06:17
merge with trunk check-in: c1fde526f9 user: chw tags: wtf-8-experiment
05:45
add tk upstream changes check-in: 598bd224b9 user: chw tags: trunk
2019-11-03
16:59
merge with trunk check-in: 263a2c3e0f user: chw tags: wtf-8-experiment
Changes

Changes to assets/tcllib1.19/math/interpolate.tcl.

249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
...
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
...
660
661
662
663
664
665
666
667
# Note:
#    The list xyvalues must be sorted w.r.t. the x-value
#
proc ::math::interpolate::interp-linear { xyvalues xval } {
   #
   # Border cases first
   #
   if { [lindex $xyvalues 0] > $xval } {
      return [lindex $xyvalues 1]
   }
   if { [lindex $xyvalues end-1] < $xval } {
      return [lindex $xyvalues end]
   }

   #
   # The ordinary case
   #
   set idxx -2
................................................................................
      incr idxy 2
   }

   set x2 [lindex $xyvalues $idxx]
   set y2 [lindex $xyvalues $idxy]

   if { $x2 != $x } {
      set yval [expr {$y+($y2-$y)*($xval-$x)/($x2-$x)}]
   } else {
      set yval $y
   }
   return $yval
}

# interp-lagrange --
#    Use the Lagrange interpolation method
#
................................................................................
}



#
# Announce our presence
#
package provide math::interpolate 1.1.1







|


|







 







|

|







 







|
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
...
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
...
660
661
662
663
664
665
666
667
# Note:
#    The list xyvalues must be sorted w.r.t. the x-value
#
proc ::math::interpolate::interp-linear { xyvalues xval } {
   #
   # Border cases first
   #
   if { [lindex $xyvalues 0]+0.0 > $xval } {
      return [lindex $xyvalues 1]
   }
   if { [lindex $xyvalues end-1]+0.0 < $xval } {
      return [lindex $xyvalues end]
   }

   #
   # The ordinary case
   #
   set idxx -2
................................................................................
      incr idxy 2
   }

   set x2 [lindex $xyvalues $idxx]
   set y2 [lindex $xyvalues $idxy]

   if { $x2 != $x } {
      set yval [expr {$y+($y2-$y)*($xval-$x)/double($x2-$x)}]
   } else {
      set yval [expr {double($y)}]
   }
   return $yval
}

# interp-lagrange --
#    Use the Lagrange interpolation method
#
................................................................................
}



#
# Announce our presence
#
package provide math::interpolate 1.1.2

Changes to assets/tcllib1.19/math/pkgIndex.tcl.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package ifneeded math::fourier           1.0.2 [list source [file join $dir fourier.tcl]]

if {![package vsatisfies [package provide Tcl] 8.3]} {return}
package ifneeded math::roman             1.0   [list source [file join $dir romannumerals.tcl]]

if {![package vsatisfies [package provide Tcl] 8.4]} {return}
package ifneeded math::optimize          1.0.1 [list source [file join $dir optimize.tcl]]
package ifneeded math::interpolate       1.1.1 [list source [file join $dir interpolate.tcl]]
package ifneeded math::bignum            3.1.1 [list source [file join $dir bignum.tcl]]
package ifneeded math::bigfloat          1.2.2 [list source [file join $dir bigfloat.tcl]]
package ifneeded math::machineparameters 0.1   [list source [file join $dir machineparameters.tcl]]

if {![package vsatisfies [package provide Tcl] 8.5]} {return}
package ifneeded math::calculus          0.8.1 [list source [file join $dir calculus.tcl]]
# statistics depends on linearalgebra (for multi-variate linear regression).







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package ifneeded math::fourier           1.0.2 [list source [file join $dir fourier.tcl]]

if {![package vsatisfies [package provide Tcl] 8.3]} {return}
package ifneeded math::roman             1.0   [list source [file join $dir romannumerals.tcl]]

if {![package vsatisfies [package provide Tcl] 8.4]} {return}
package ifneeded math::optimize          1.0.1 [list source [file join $dir optimize.tcl]]
package ifneeded math::interpolate       1.1.2 [list source [file join $dir interpolate.tcl]]
package ifneeded math::bignum            3.1.1 [list source [file join $dir bignum.tcl]]
package ifneeded math::bigfloat          1.2.2 [list source [file join $dir bigfloat.tcl]]
package ifneeded math::machineparameters 0.1   [list source [file join $dir machineparameters.tcl]]

if {![package vsatisfies [package provide Tcl] 8.5]} {return}
package ifneeded math::calculus          0.8.1 [list source [file join $dir calculus.tcl]]
# statistics depends on linearalgebra (for multi-variate linear regression).

Changes to jni/sdl2tk/library/iconlist.tcl.

443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
	bind $canvas <Double-ButtonRelease-1> \
	    [namespace code {my Double1 %x %y}]

	bind $canvas <Control-B1-Motion> {;}
	bind $canvas <Shift-B1-Motion>	[namespace code {my ShiftMotion1 %x %y}]

	if {[tk windowingsystem] eq "aqua"} {
	    bind $canvas <Shift-MouseWheel>	[namespace code {my MouseWheel [expr {40 * (%W)}]}]
	    bind $canvas <Option-Shift-MouseWheel>	[namespace code {my MouseWheel [expr {400 * (%W)}]}]
	} else {
	    bind $canvas <Shift-MouseWheel>	[namespace code {my MouseWheel %W}]
	}
	if {[tk windowingsystem] eq "x11"} {
	    bind $canvas <Shift-4>	[namespace code {my MouseWheel 120}]
	    bind $canvas <Shift-5>	[namespace code {my MouseWheel -120}]
	}

	bind $canvas <<PrevLine>>	[namespace code {my UpDown -1}]







|
|

|







443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
	bind $canvas <Double-ButtonRelease-1> \
	    [namespace code {my Double1 %x %y}]

	bind $canvas <Control-B1-Motion> {;}
	bind $canvas <Shift-B1-Motion>	[namespace code {my ShiftMotion1 %x %y}]

	if {[tk windowingsystem] eq "aqua"} {
	    bind $canvas <Shift-MouseWheel>	[namespace code {my MouseWheel [expr {40 * (%D)}]}]
	    bind $canvas <Option-Shift-MouseWheel>	[namespace code {my MouseWheel [expr {400 * (%D)}]}]
	} else {
	    bind $canvas <Shift-MouseWheel>	[namespace code {my MouseWheel %D}]
	}
	if {[tk windowingsystem] eq "x11"} {
	    bind $canvas <Shift-4>	[namespace code {my MouseWheel 120}]
	    bind $canvas <Shift-5>	[namespace code {my MouseWheel -120}]
	}

	bind $canvas <<PrevLine>>	[namespace code {my UpDown -1}]

Changes to jni/sdl2tk/library/listbox.tcl.

191
192
193
194
195
196
197

198


199

200

201



202
203
204
205
206
207
208
        %W xview scroll [expr {-(%D)}] units
    }
    bind Listbox <Shift-Option-MouseWheel> {
        %W xview scroll [expr {-10 * (%D)}] units
    }
} else {
    bind Listbox <MouseWheel> {

        %W yview scroll [expr {-(%D/30)}] units


    }

    bind Listbox <Shift-MouseWheel> {

        %W xview scroll [expr {-(%D/30)}] units



    }
}

if {[tk windowingsystem] eq "x11"} {
    # Support for mousewheels on Linux/Unix commonly comes through mapping
    # the wheel to the extended buttons.  If you have a mousewheel, find
    # Linux configuration info at:







>
|
>
>
|
>

>
|
>
>
>







191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
        %W xview scroll [expr {-(%D)}] units
    }
    bind Listbox <Shift-Option-MouseWheel> {
        %W xview scroll [expr {-10 * (%D)}] units
    }
} else {
    bind Listbox <MouseWheel> {
	if {%D >= 0} {
	    %W yview scroll [expr {-%D/30}] units
	} else {
	    %W yview scroll [expr {(29-%D)/30}] units
	}
    }
    bind Listbox <Shift-MouseWheel> {
	if {%D >= 0} {
	    %W xview scroll [expr {-%D/30}] units
	} else {
	    %W xview scroll [expr {(29-%D)/30}] units
	}
    }
}

if {[tk windowingsystem] eq "x11"} {
    # Support for mousewheels on Linux/Unix commonly comes through mapping
    # the wheel to the extended buttons.  If you have a mousewheel, find
    # Linux configuration info at:

Changes to jni/sdl2tk/library/scrlbar.tcl.

124
125
126
127
128
129
130

131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147

148


149

150

151


152
153
154
155
156
157
158
159
160

161
162
163
164
165
166
167
168
169
170
171
172
173
bind Scrollbar <<LineStart>> {
    tk::ScrollToPos %W 0
}
bind Scrollbar <<LineEnd>> {
    tk::ScrollToPos %W 1
}
}

switch [tk windowingsystem] {
    "aqua" {
	bind Scrollbar <MouseWheel> {
	    tk::ScrollByUnits %W v [expr {-(%D)}]
	}
	bind Scrollbar <Option-MouseWheel> {
	    tk::ScrollByUnits %W v [expr {-10 * (%D)}]
	}
	bind Scrollbar <Shift-MouseWheel> {
	    tk::ScrollByUnits %W h [expr {-(%D)}]
	}
	bind Scrollbar <Shift-Option-MouseWheel> {
	    tk::ScrollByUnits %W h [expr {-10 * (%D)}]
	}
    }
    "win32" {
	bind Scrollbar <MouseWheel> {

	    tk::ScrollByUnits %W v [expr {-(%D / 30)}]


	}

	bind Scrollbar <Shift-MouseWheel> {

	    tk::ScrollByUnits %W h [expr {-(%D / 30)}]


	}
    }
    "x11" {
	bind Scrollbar <MouseWheel> {
	    tk::ScrollByUnits %W v [expr {-(%D / 30)}]
	}
	bind Scrollbar <Shift-MouseWheel> {
	    tk::ScrollByUnits %W h [expr {-(%D / 30)}]
	}

	bind Scrollbar <4> {tk::ScrollByUnits %W v -5}
	bind Scrollbar <5> {tk::ScrollByUnits %W v 5}
	bind Scrollbar <Shift-4> {tk::ScrollByUnits %W h -5}
	bind Scrollbar <Shift-5> {tk::ScrollByUnits %W h 5}
    }
}
# tk::ScrollButtonDown --
# This procedure is invoked when a button is pressed in a scrollbar.
# It changes the way the scrollbar is displayed and takes actions
# depending on where the mouse is.
#
# Arguments:
# w -		The scrollbar widget.







>
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
>
|
>
>

>
|
>
|
>
>


<
<
<
|
<
<
|
>
|
|
|
|
|
|







124
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139
140
141
142
143
144
145

146
147
148
149
150
151
152
153
154
155
156
157
158
159



160


161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
bind Scrollbar <<LineStart>> {
    tk::ScrollToPos %W 0
}
bind Scrollbar <<LineEnd>> {
    tk::ScrollToPos %W 1
}
}

if {[tk windowingsystem] eq "aqua"} {

    bind Scrollbar <MouseWheel> {
	tk::ScrollByUnits %W v [expr {-(%D)}]
    }
    bind Scrollbar <Option-MouseWheel> {
	tk::ScrollByUnits %W v [expr {-10 * (%D)}]
    }
    bind Scrollbar <Shift-MouseWheel> {
	tk::ScrollByUnits %W h [expr {-(%D)}]
    }
    bind Scrollbar <Shift-Option-MouseWheel> {
	tk::ScrollByUnits %W h [expr {-10 * (%D)}]
    }
} else {

    bind Scrollbar <MouseWheel> {
	if {%D >= 0} {
	    tk::ScrollByUnits %W v [expr {-%D/30}]
	} else {
	    tk::ScrollByUnits %W v [expr {(29-%D)/30}]
	}
    }
    bind Scrollbar <Shift-MouseWheel> {
	if {%D >= 0} {
	    tk::ScrollByUnits %W h [expr {-%D/30}]
	} else {
	    tk::ScrollByUnits %W h [expr {(29-%D)/30}]
	}
    }



}



if {[tk windowingsystem] eq "x11"} {
    bind Scrollbar <4> {tk::ScrollByUnits %W v -5}
    bind Scrollbar <5> {tk::ScrollByUnits %W v 5}
    bind Scrollbar <Shift-4> {tk::ScrollByUnits %W h -5}
    bind Scrollbar <Shift-5> {tk::ScrollByUnits %W h 5}
}

# tk::ScrollButtonDown --
# This procedure is invoked when a button is pressed in a scrollbar.
# It changes the way the scrollbar is displayed and takes actions
# depending on where the mouse is.
#
# Arguments:
# w -		The scrollbar widget.

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

1620
1621
1622
1623
1624
1625
1626
1627
1628

1629
1630
1631
1632









1633
1634
1635
1636

1637
1638
1639
1640
1641
1642
1643

	/*
	 * We can only draw into the view when the current CGContext is valid
	 * and belongs to the view.  Validity can only be guaranteed inside of
	 * a view's drawRect or setFrame methods.  The isDrawing attribute
	 * tells us whether we are being called from one of those methods.
	 *
	 * If the CGContext is not valid, or belongs to a different View, then
	 * we mark our view as needing display and return failure. It should

	 * get drawn in a later call to drawRect.
	 */

	if (view != [NSView focusView]) {









	    [view setNeedsDisplay:YES];
	    canDraw = false;
	    goto end;
	}

	dc.view = view;
	dc.context = GET_CGCONTEXT;
	dc.portBounds = NSRectToCGRect([view bounds]);
	if (dc.clipRgn) {
	    clipBounds = CGContextGetClipBoundingBox(dc.context);
	}
    } else {







|
|
>
|

|
|
>
>
>
>
>
>
>
>
>
|



>







1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654

	/*
	 * We can only draw into the view when the current CGContext is valid
	 * and belongs to the view.  Validity can only be guaranteed inside of
	 * a view's drawRect or setFrame methods.  The isDrawing attribute
	 * tells us whether we are being called from one of those methods.
	 *
	 * If the CGContext is not valid then we mark our view as needing
	 * display in the bounding rectangle of the clipping region and
	 * return failure.  That rectangle should get drawn in a later call
	 * to drawRect.
	 */
 
	if (![NSApp isDrawing] || view != [NSView focusView]) {
	    NSRect bounds = [view bounds];
	    NSRect dirtyNS = bounds;
	    CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0,
				    .ty = dirtyNS.size.height};
	    if (dc.clipRgn) {
		CGRect dirtyCG = NSRectToCGRect(dirtyNS);
		HIShapeGetBounds(dc.clipRgn, &dirtyCG);
		dirtyNS = NSRectToCGRect(CGRectApplyAffineTransform(dirtyCG, t));
	    }
	    [view setNeedsDisplayInRect:dirtyNS];
	    canDraw = false;
	    goto end;
	}
 
	dc.view = view;
	dc.context = GET_CGCONTEXT;
	dc.portBounds = NSRectToCGRect([view bounds]);
	if (dc.clipRgn) {
	    clipBounds = CGContextGetClipBoundingBox(dc.context);
	}
    } else {

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

606
607
608
609
610
611
612







613



614
615

616

617
618
619
620
621
622
623
		CreateNamedSystemFont(interp, tkwin, systemFont->tkName1, &fa);
	    }
	    CFRelease(nsFont);
	}
	systemFont++;
    }
    TkInitFontAttributes(&fa);







    nsFont = (NSFont*) CTFontCreateUIFontForLanguage(fixedPitch, 11, NULL);



    if (nsFont) {
	GetTkFontAttributesForNSFont(nsFont, &fa);

	CFRelease(nsFont);

    } else {
	fa.family = Tk_GetUid("Monaco");
	fa.size = 11;
	fa.weight = TK_FW_NORMAL;
	fa.slant = TK_FS_ROMAN;
    }
    CreateNamedSystemFont(interp, tkwin, "TkFixedFont", &fa);







>
>
>
>
>
>
>

>
>
>


>

>







606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
		CreateNamedSystemFont(interp, tkwin, systemFont->tkName1, &fa);
	    }
	    CFRelease(nsFont);
	}
	systemFont++;
    }
    TkInitFontAttributes(&fa);
#if 0
    /*
     * In macOS 10.15.1 Apple introduced a bug which caused the call below to
     * return a font with the invalid familyName ".SF NSMono" instead of the
     * valid familyName "NSMono". Calling [NSFont userFixedPitchFontOfSize:11]
     * returns a font in the "Menlo" family which has a valid familyName.
     */  
    nsFont = (NSFont*) CTFontCreateUIFontForLanguage(fixedPitch, 11, NULL);
#else
    nsFont = [NSFont userFixedPitchFontOfSize:11];
#endif
    if (nsFont) {
	GetTkFontAttributesForNSFont(nsFont, &fa);
#if 0
	CFRelease(nsFont);
#endif
    } else {
	fa.family = Tk_GetUid("Monaco");
	fa.size = 11;
	fa.weight = TK_FW_NORMAL;
	fa.slant = TK_FS_ROMAN;
    }
    CreateNamedSystemFont(interp, tkwin, "TkFixedFont", &fa);