[PD-cvs] pd/src pd_base.tk, 1.1.2.5, 1.1.2.6 pd_objects.tk, 1.1.2.8, 1.1.2.9
carmen rocco
ix9 at users.sourceforge.net
Mon Sep 12 19:36:50 CEST 2005
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23927
Modified Files:
Tag: devel_0_39
pd_base.tk pd_objects.tk
Log Message:
Index: pd_objects.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/pd_objects.tk,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** pd_objects.tk 12 Sep 2005 13:34:46 -0000 1.1.2.8
--- pd_objects.tk 12 Sep 2005 17:36:48 -0000 1.1.2.9
***************
*** 7,12 ****
}
defaults {
! ins 1
! outs 3
zero_x 0
zero_y 1
--- 7,14 ----
}
defaults {
! x 1 y 1
! ins 2
! outs 2
! color {123 232 4}
zero_x 0
zero_y 1
***************
*** 114,117 ****
--- 116,120 ----
cable {
defaults {
+ class cable
x 10 y 10
from ""
***************
*** 119,123 ****
}
init {
! $p create line 0 0 0 0 -tags $tags -fill green -arrow last -width 8
}
destroy {
--- 122,126 ----
}
init {
! $p create line 0 0 0 0 -tags $tags -fill green -arrow last -width 4
}
destroy {
***************
*** 125,135 ****
}
redraw {
! if {$from ne "" && [llength $from] == 2 } {
! set loc [ioloc $p $t [lindex $from 0] [lindex $from 1] out]
! set $x [lindex $loc 0]; set y [lindex $loc 1]
}
! if {$to ne "" && [llength $to] == 2 } {
! set loc [ioloc $p $t [lindex $to 0] [lindex $to 1] in]
! set $xx [lindex $loc 0]; set yy [lindex $loc 1]
}
$p coords $item $x $y $xx $yy
--- 128,138 ----
}
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
***************
*** 139,156 ****
}
proc {
! proc ioloc {p t id n side} {
variable ""
! array set ax {x x xx x y y yy y}
! foreach c {x y xx yy} {
! set $c [tr $p $t $ax($c) t [dict get $($t) $id $c]]}
! # puts "obj $x $y $xx $yy"
! array set nio "out [dict get $($t) $id outs] in [dict get $($t) $id ins]"
! set pos [expr $n / $nio($side).0 * ($xx - $x + 0.0) + $x]
! # puts "io $pos $y"
! return [list $pos $y]
}
}
}
msg {
tags {
--- 142,165 ----
}
proc {
! proc ioloc {p t id n io} {
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]
}
}
}
+ io {
+ init {
+ puts "io $ins $outs"
+ }
+ redraw {
+ puts "RedrawIO $ins $outs"
+ }
+ }
+
msg {
tags {
Index: pd_base.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/pd_base.tk,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** pd_base.tk 12 Sep 2005 13:34:46 -0000 1.1.2.5
--- pd_base.tk 12 Sep 2005 17:36:47 -0000 1.1.2.6
***************
*** 7,13 ****
io/cables
scale selection
- gridlines -> objects
$p and $t are probably redundant (combine)
! port some complex widgets to test out feasability of this structure
}
--- 7,12 ----
io/cables
scale selection
$p and $t are probably redundant (combine)
! port some complex widgets
}
***************
*** 69,73 ****
if {[dict exists $da y]} {set sy [dict get $da y]} {set sy 0}
! update $p $t $id abs [dict merge [dict merge [dict merge {class item color {128 128 128}} $da] [dict remove $a id]] [dict create x $x xx [expr $x + $sx] y $y yy [expr $y + $sy]]] 0
item_draw $p $t $id
return $id}
--- 68,72 ----
if {[dict exists $da y]} {set sy [dict get $da y]} {set sy 0}
! update $p $t $id abs [dict merge [dict merge [dict merge {class item ins 0 outs 0 color {128 128 128}} $da] [dict remove $a id]] [dict create x $x xx [expr $x + $sx] y $y yy [expr $y + $sy]]] 0
item_draw $p $t $id
return $id}
***************
*** 85,88 ****
--- 84,90 ----
set rgb $color; set color [color $rgb]
eval [dict get $obj $type init]
+ if {$class eq "item" && ($ins > 0 || $outs > 0)} {
+ eval [dict get $obj io init]
+ }
}
redraw $p $t $id
***************
*** 166,170 ****
set $tag [$p find withtag "$tags && $tag"]}}
eval [dict get $obj $type redraw]
! # redraw_io $p $t $id
}
}
--- 168,181 ----
set $tag [$p find withtag "$tags && $tag"]}}
eval [dict get $obj $type redraw]
! if {$class eq "item" && ($ins > 0 || $outs > 0)} {
! eval [dict get $obj io redraw]
! foreach i [dict keys $($t)] {
! if {[dict get $($t) $i class] eq "cable"} {
! if {[lindex [dict get $($t) $i from] 0] eq $id || [lindex [dict get $($t) $i to] 0] eq $id} {
! redraw $p $t $i
! }
! }
! }
! }
}
}
***************
*** 213,217 ****
proc cleansel {p t sel} {
set clean {}
! foreach item $sel {if {[lindex [$p itemcget $item -tags] 0] eq "item"} {lappend clean [lindex [$p itemcget $item -tags] 2]}}
set clean [lsort -unique $clean]
return $clean
--- 224,230 ----
proc cleansel {p t sel} {
set clean {}
! foreach item $sel {
! set class [lindex [$p itemcget $item -tags] 0]
! if {$class eq "item" || $class eq "cable"} {lappend clean [lindex [$p itemcget $item -tags] 2]}}
set clean [lsort -unique $clean]
return $clean
***************
*** 268,272 ****
proc item_info {p t clicked} {
variable ""
! # return
set n 0;$p delete hover
foreach item $clicked {
--- 281,285 ----
proc item_info {p t clicked} {
variable ""
! return
set n 0;$p delete hover
foreach item $clicked {
***************
*** 473,477 ****
switch $action {
selecta {
! updatesel $p $t [dict keys $($t)]
}
cut {
--- 486,492 ----
switch $action {
selecta {
! set items {}
! foreach i [dict keys $($t)] {if {[dict get $($t) $i class] eq "item"} {lappend items $i}}
! updatesel $p $t $items
}
cut {
More information about the Pd-cvs
mailing list