Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21835
Modified Files: Tag: devel_0_39 pd_base.tk pd_objects.tk Log Message: $p and $t are obsolete
Index: pd_objects.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/pd_objects.tk,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -C2 -d -r1.1.2.9 -r1.1.2.10 *** pd_objects.tk 12 Sep 2005 17:36:48 -0000 1.1.2.9 --- pd_objects.tk 13 Sep 2005 11:09:45 -0000 1.1.2.10 *************** *** 18,39 **** } init { ! $p create rect 0 0 0 0 -tags [concat $tags box] if {$img ne ""} { package require Img image create photo photo$id ! $p create image 0 0 -tags [concat $tags img] } } redraw { ! if {[expr $zero_x == 1]} {set zs_x [tr $p $t x id $zs_x]; set xx [expr $x + $zs_x]; set x [expr $x - $zs_x]} ! if {[expr $zero_y == 1]} {set zs_y [tr $p $t y id $zs_y]; set yy [expr $y + $zs_y]; set y [expr $y - $zs_y]} ! $p coords $box $x $y $xx $yy ! $p coords $img $x $y if {$img ne ""} { photo$id configure -file $img set photo photo$id } {set photo ""} ! $p itemconfigure $img -image $photo ! $p itemconfigure $box -fill $color -outline [color [lighten $rgb 0.3]] -width [expr $selected + 1] } } --- 18,39 ---- } init { ! $_ create rect 0 0 0 0 -tags [concat $tags box] if {$img ne ""} { package require Img image create photo photo$id ! $_ create image 0 0 -tags [concat $tags img] } } redraw { ! if {[expr $zero_x == 1]} {set zs_x [tr $_ x id $zs_x]; set xx [expr $x + $zs_x]; set x [expr $x - $zs_x]} ! if {[expr $zero_y == 1]} {set zs_y [tr $_ y id $zs_y]; set yy [expr $y + $zs_y]; set y [expr $y - $zs_y]} ! $_ coords $box $x $y $xx $yy ! $_ coords $img $x $y if {$img ne ""} { photo$id configure -file $img set photo photo$id } {set photo ""} ! $_ itemconfigure $img -image $photo ! $_ itemconfigure $box -fill $color -outline [color [lighten $rgb 0.3]] -width [expr $selected + 1] } } *************** *** 43,52 **** } redraw { ! foreach items $item {$p delete $items} foreach xy {x y} { array set ta {x n y w} array set tj {x center y left} array set igx {y width x height} ! set range [expr abs($($t:${xy}b) - $($t:${xy}a))] set nSlices [expr $range / $${xy}q] if {$nSlices > [set ${xy}m]} {set factor [expr int($nSlices / ($${xy}m + 0.0) + 1)]} else { --- 43,52 ---- } redraw { ! foreach items $item {$_ delete $items} foreach xy {x y} { array set ta {x n y w} array set tj {x center y left} array set igx {y width x height} ! set range [expr abs($($_:${xy}b) - $($_:${xy}a))] set nSlices [expr $range / $${xy}q] if {$nSlices > [set ${xy}m]} {set factor [expr int($nSlices / ($${xy}m + 0.0) + 1)]} else { *************** *** 54,65 **** } set increment [expr $${xy}q * $factor] ! for {set x [expr int($($t:${xy}a) / ($increment + 0.0) + 1)*($increment + 0.0)]} {[expr $($t:${xy}a) > $($t:${xy}b) ? $x >= $($t:${xy}b) : $x <= $($t:${xy}b)]} {set x [expr $($t:${xy}a) > $($t:${xy}b) ? $x - $increment : $x + $increment]} { ! set og [tr $p $t $xy t $x] ! set invgeo [winfo $igx($xy) $p] switch $xy { y {set coords [concat 0 $og $invgeo $og]} x {set coords [concat $og 0 $og $invgeo]}} ! $p lower [$p create text [lrange $coords 0 1] -font {{Bitstream Vera Sans} 8} -fill [rc] -anchor $ta($xy) -text [string range $x 0 7] -justify $tj($xy) -tags $atags] ! $p lower [$p create line $coords -fill $color -stipple gray50 -tags $atags] } } --- 54,65 ---- } set increment [expr $${xy}q * $factor] ! for {set x [expr int($($_:${xy}a) / ($increment + 0.0) + 1)*($increment + 0.0)]} {[expr $($_:${xy}a) > $($_:${xy}b) ? $x >= $($_:${xy}b) : $x <= $($_:${xy}b)]} {set x [expr $($_:${xy}a) > $($_:${xy}b) ? $x - $increment : $x + $increment]} { ! set og [tr $_ $xy t $x] ! set invgeo [winfo $igx($xy) $_] switch $xy { y {set coords [concat 0 $og $invgeo $og]} x {set coords [concat $og 0 $og $invgeo]}} ! $_ lower [$_ create text [lrange $coords 0 1] -font {{Bitstream Vera Sans} 8} -fill [rc] -anchor $ta($xy) -text [string range $x 0 7] -justify $tj($xy) -tags $atags] ! $_ lower [$_ create line $coords -fill $color -stipple gray50 -tags $atags] } } *************** *** 76,92 **** } init { ! $p create rect 0 0 0 0 -tags [concat $tags box] ! new $p.$id ${t}$id {bg gray86 ln white sc orange samplerate 44100 xa 0 xb 100 ya 0 yb 100 qx 10 qy 10 mx 15 my 15} ! $p create window 0 0 -tags [concat $tags subwin] -window $p.$id -anchor nw } redraw { ! $p coords $box [expr $x - 10] $y $xx $yy ! $p coords $subwin $x $y set w [expr $xx - $x] set h [expr $yy - $y] ! if {[expr abs($w - [$p.$id cget -width]) >= 1 || abs($h - [$p.$id cget -height]) >= 1]} { ! $p.$id configure -width $w -height $h } ! $p itemconfigure $box -fill $color } } --- 76,92 ---- } init { ! $_ create rect 0 0 0 0 -tags [concat $tags box] ! new $_.$id ${t}$id {bg gray86 ln white sc orange samplerate 44100 xa 0 xb 100 ya 0 yb 100 qx 10 qy 10 mx 15 my 15} ! $_ create window 0 0 -tags [concat $tags subwin] -window $_.$id -anchor nw } redraw { ! $_ coords $box [expr $x - 10] $y $xx $yy ! $_ coords $subwin $x $y set w [expr $xx - $x] set h [expr $yy - $y] ! if {[expr abs($w - [$_.$id cget -width]) >= 1 || abs($h - [$_.$id cget -height]) >= 1]} { ! $_.$id configure -width $w -height $h } ! $_ itemconfigure $box -fill $color } } *************** *** 104,114 **** } init { ! $p create rect 0 0 0 0 -tags [concat $tags box] -fill gray90 ! $p create rect 0 0 0 0 -tags [concat $tags loc] -fill red } redraw { ! $p coords $box $x $y $xx $yy ! $p coords $loc $x $y [expr $x + ($xx - $x) / 12.] [expr $y + ($yy - $y)/12.] ! $p itemconfigure $box -outline $color } } --- 104,114 ---- } init { ! $_ create rect 0 0 0 0 -tags [concat $tags box] -fill gray90 ! $_ create rect 0 0 0 0 -tags [concat $tags loc] -fill red } redraw { ! $_ coords $box $x $y $xx $yy ! $_ coords $loc $x $y [expr $x + ($xx - $x) / 12.] [expr $y + ($yy - $y)/12.] ! $_ itemconfigure $box -outline $color } } *************** *** 122,126 **** } init { ! $p create line 0 0 0 0 -tags $tags -fill green -arrow last -width 4 } destroy { --- 122,126 ---- } init { ! $_ create line 0 0 0 0 -tags $tags -fill green -arrow last -width 4 } destroy { *************** *** 129,140 **** redraw { if {[llength $from] == 2 } { ! set loc [ioloc $p $t [lindex $from 0] [lindex $from 1] outs] lassign $loc x y } if {[llength $to] == 2 } { ! set loc [ioloc $p $t [lindex $to 0] [lindex $to 1] ins] lassign $loc xx yy } ! $p coords $item $x $y $xx $yy } control { --- 129,140 ---- redraw { if {[llength $from] == 2 } { ! set loc [ioloc $_ [lindex $from 0] [lindex $from 1] outs] lassign $loc x y } if {[llength $to] == 2 } { ! set loc [ioloc $_ [lindex $to 0] [lindex $to 1] ins] lassign $loc xx yy } ! $_ coords $item $x $y $xx $yy } control { *************** *** 145,151 **** variable "" foreach c {x xx y yy} { ! set $c [tr $p $t [string range $c 0 0] t [dict get $($t) $id $c]]} if {$io eq "ins"} {set py $y} {set py $yy} ! set px [expr ($n / ([dict get $($t) $id $io] + 0.0)) * ($xx - $x + 0.0) + $x] return [list $px $py] } --- 145,151 ---- variable "" foreach c {x xx y yy} { ! set $c [tr $_ [string range $c 0 0] t [dict get $($_) $id $c]]} if {$io eq "ins"} {set py $y} {set py $yy} ! set px [expr ($n / ([dict get $($_) $id $io] + 0.0)) * ($xx - $x + 0.0) + $x] return [list $px $py] } *************** *** 155,162 **** io { init { ! puts "io $ins $outs" } redraw { ! puts "RedrawIO $ins $outs" } } --- 155,176 ---- io { init { ! # puts "io $ins $outs" } redraw { ! # puts "RedrawIO $ins $outs" ! } ! } ! ! button { ! tags {box button} ! defaults {x 3 y 3 ins 1 outs 1} ! init { ! $_ create rect 0 0 0 0 -tags [concat $tags box] ! $_ create oval 0 0 0 0 -tags [concat $tags button] ! } ! redraw { ! $_ itemconfigure $box -fill $color ! $_ coords $box $x $y $xx $yy ! $_ coords $button $x $y $xx $yy } } *************** *** 173,186 **** } init { ! $p create polygon 0 0 0 0 -tags [concat $tags box] ! $p create text 0 0 -tags [concat $tags txt] -fill white -anchor nw -justify left } redraw { ! $p coords $txt $x $y ! $p itemconfigure $box -fill $color ! $p itemconfigure $txt -font [list {bitstream vera sans} [expr int($sy)]] -text $msg ! lassign [$p bbox $txt] x y xx yy set flare [expr $xx + ($xx - $x) / 10.] ! $p coords $box $x $y $flare $y $xx [expr $y + ($yy - $y)/2.] $flare $yy $x $yy } } --- 187,200 ---- } init { ! $_ create polygon 0 0 0 0 -tags [concat $tags box] ! $_ create text 0 0 -tags [concat $tags txt] -fill white -anchor nw -justify left } redraw { ! $_ coords $txt $x $y ! $_ itemconfigure $box -fill $color ! $_ itemconfigure $txt -font [list {bitstream vera sans} [expr int($sy)]] -text $msg ! lassign [$_ bbox $txt] x y xx yy set flare [expr $xx + ($xx - $x) / 10.] ! $_ coords $box $x $y $flare $y $xx [expr $y + ($yy - $y)/2.] $flare $yy $x $yy } } *************** *** 199,207 **** } init { ! $p create rect 0 0 0 0 -tags [concat $tags box] -fill $color ! $p create rect 0 0 0 0 -tags [concat $tags pos] -fill green -width 0 } redraw { ! $p coords $box $x $y $xx $yy if {[expr ($xx - $x) > ($yy - $y)]} {set orient h} {set orient v} set v [expr ($v - $min + 0.) / ($max - $min + 0.)] --- 213,221 ---- } init { ! $_ create rect 0 0 0 0 -tags [concat $tags box] -fill $color ! $_ create rect 0 0 0 0 -tags [concat $tags pos] -fill green -width 0 } redraw { ! $_ coords $box $x $y $xx $yy if {[expr ($xx - $x) > ($yy - $y)]} {set orient h} {set orient v} set v [expr ($v - $min + 0.) / ($max - $min + 0.)] *************** *** 216,224 **** } } ! $p coords $pos $coords } control { Button-1 { ! update $p $t $id rel [dict create v [expr {($x - $($t:cx)) / 100.0 * ($max - $min + 0.)}]] 1 } } --- 230,238 ---- } } ! $_ coords $pos $coords } control { Button-1 { ! update $_ $id rel [dict create v [expr {($x - $($_:cx)) / 100.0 * ($max - $min + 0.)}]] 1 } } *************** *** 235,261 **** init { snack:::sound s$id ! set filename [dict get $($t) $id filename] s$id read $filename ! $p create path [::tkpath::coords rect 0 0 0 0 -rx 3 -ry 3] -tags [concat $tags r] -strokewidth 0 -fill $color -fillopacity 0.08 ! $p create waveform 0 0 -tags [concat $tags w] -sound s$id -fill white ! set length [expr [s$id length] / ($($t:samplerate) + 0.0) * 1000] ! update $p $t $id abs [dict create xx [expr [dict get $($t) $id x] + $length]] 0 ! $p create text 0 0 -tags [concat $tags tl] -font {{bitstream vera sans} 8} -fill HotPink -anchor nw -justify left -text "[string range $length 0 10] s" ! $p create rectangle 0 0 0 0 -tags [concat $tags tlr] -fill LightGreen -width 0 ! $p raise $tl ! $p create text 0 0 -tags [concat $tags tf] -font {{bitstream vera sans} 8} -fill NavyBlue -anchor ne -justify right -text $filename ! $p create rectangle 0 0 0 0 -tags [concat $tags tfr] -fill gray90 -width 0 ! $p raise $tf } redraw { set ro 6 ! $p coords $r [::tkpath::coords rect $x $y $sx $sy -rx $ro -ry $ro] ! $p itemconfigure $r -fillopacity [dict get $($t) $id v] -fill $color ! $p coords $w $x $y ! $p itemconfigure $w -width $sx -height [expr int($sy)] ! $p coords $tl [expr $x + 4] [expr $y + 4] ! $p coords $tlr [$p bbox $tl] ! $p coords $tf [expr $x + $sx] [expr $y + 4] ! $p coords $tfr [$p bbox $tf] } } --- 249,275 ---- init { snack:::sound s$id ! set filename [dict get $($_) $id filename] s$id read $filename ! $_ create path [::tkpath::coords rect 0 0 0 0 -rx 3 -ry 3] -tags [concat $tags r] -strokewidth 0 -fill $color -fillopacity 0.08 ! $_ create waveform 0 0 -tags [concat $tags w] -sound s$id -fill white ! set length [expr [s$id length] / ($($_:samplerate) + 0.0) * 1000] ! update $_ $id abs [dict create xx [expr [dict get $($_) $id x] + $length]] 0 ! $_ create text 0 0 -tags [concat $tags tl] -font {{bitstream vera sans} 8} -fill HotPink -anchor nw -justify left -text "[string range $length 0 10] s" ! $_ create rectangle 0 0 0 0 -tags [concat $tags tlr] -fill LightGreen -width 0 ! $_ raise $tl ! $_ create text 0 0 -tags [concat $tags tf] -font {{bitstream vera sans} 8} -fill NavyBlue -anchor ne -justify right -text $filename ! $_ create rectangle 0 0 0 0 -tags [concat $tags tfr] -fill gray90 -width 0 ! $_ raise $tf } redraw { set ro 6 ! $_ coords $r [::tkpath::coords rect $x $y $sx $sy -rx $ro -ry $ro] ! $_ itemconfigure $r -fillopacity [dict get $($_) $id v] -fill $color ! $_ coords $w $x $y ! $_ itemconfigure $w -width $sx -height [expr int($sy)] ! $_ coords $tl [expr $x + 4] [expr $y + 4] ! $_ coords $tlr [$_ bbox $tl] ! $_ coords $tf [expr $x + $sx] [expr $y + 4] ! $_ coords $tfr [$_ bbox $tf] } }
Index: pd_base.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/pd_base.tk,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** pd_base.tk 12 Sep 2005 17:36:47 -0000 1.1.2.6 --- pd_base.tk 13 Sep 2005 11:09:45 -0000 1.1.2.7 *************** *** 5,12 ****
set todo { ! io/cables scale selection ! $p and $t are probably redundant (combine) port some complex widgets }
--- 5,13 ----
[...1128 lines suppressed...] foreach m {"Control-" "" "Shift-" "Double-"} { foreach bn {1 2 3} { set b [list [concat $bn first] [concat B${bn}-Motion motion] [concat ButtonRelease-$bn release]] foreach ba {0 1 2} { ! bind $_ <$m[lindex [lindex $b $ba] 0]> "::pd::click [list [string tolower [string trimright $m -1]]] $bn [lindex [lindex $b $ba] 1] $_ %x %y %X %Y"}}} ! if {$::has_tkdnd == 1} {dnd bindtarget $_ text/plain <Drop> "::pd::drop $_ %D %x %y"} ! set bd [expr {[$_ cget -bd] * 2}] ! $_ configure -bg gray -width [expr {[winfo width $_] + $bd}] -height [expr {[winfo height $_] + $bd}] ! if {[info exists ($_)] != 1} { ! set ($_) {} ! set ($_:g) {} set i -1; set sel {} ! foreach a {i sel} {set ($_:$a) [set $a]} } } foreach a {ln xa xb ya yb xq yq xm ym} {set $a [dict get $opts $a]} ! item_new $_ [dict create type gridlines id grid xa $xa xb $xb ya $ya yb $yb xq $xq yq $yq xm $xm ym $ym] ! item_draw $_ all }