Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25233
Modified Files: Tag: devel_0_39 desire.tk Log Message: new paste feature supports subpatches
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.580 retrieving revision 1.1.2.581 diff -C2 -d -r1.1.2.580 -r1.1.2.581 *** desire.tk 21 Nov 2006 07:01:34 -0000 1.1.2.580 --- desire.tk 21 Nov 2006 07:57:21 -0000 1.1.2.581 *************** *** 2702,2707 ****
def Canvas paste {} { - global clipboard - #$self copy_times= [expr [$self copy_times] + 1] $self do_paste [expr [$self copy_times] * 15] $self copy_times= [expr [$self copy_times] + 1] --- 2702,2705 ---- *************** *** 2709,2712 **** --- 2707,2716 ----
def Canvas do_paste {offset} { + pd .$self push + pd [$::clipboard value] + pd #X pop 1 + } + + def Canvas do_paste_oldstyle {offset} { global clipboard subpatcherize set n [llength $@children] ;# is a racecondition *************** *** 4137,4142 **** #A 0 0; proc update_object {self e ninlets noutlets} { ! parse_line $self $e ! #foreach mess [split $e ";"] {update_object_2 $self $mess} if {[lindex $e 1] == "array"} { $self ninlets= 0 --- 4141,4145 ---- #A 0 0; proc update_object {self e ninlets noutlets} { ! foreach mess [pd_mess_split $e] {update_object_2 $self $mess} if {[lindex $e 1] == "array"} { $self ninlets= 0 *************** *** 4195,4202 **** }
! proc parse_line {self e} { ! #first replace every "\n" by a " ", then replace every "\;" by a "\n", then ! #split on ";", then replace every "\n" by a "\;" ! regsub -all "\n" $e " " y regsub -all {\;} $y "\n" z --- 4198,4205 ---- }
! # split at message boundaries. ! # \n is wiped, then that character is reused temporarily to mean a quoted semicolon. ! proc pd_mess_split {e} { ! set r {} regsub -all "\n" $e " " y regsub -all {\;} $y "\n" z *************** *** 4204,4214 **** if {$mess != ""} { regsub -all "\n" $mess "\;" x ! update_object_2 $self [string trimleft $x] } - } }
- ############ rendering
--- 4207,4216 ---- if {$mess != ""} { regsub -all "\n" $mess "\;" x ! lappend r [string trimleft $x] } } + return $r }
############ rendering
*************** *** 7221,7225 **** lappend r #N canvas $@canvasx1 $@canvasy1 $@canvasxs $@canvasys if {$@subpatch} {lappend r $@name $@mapped} else {lappend r $@fontsize} ! $stream << "$r;\n" foreach child $@children {eval [concat [list $child deconstruct_to $stream]]} foreach wire $@wires {eval [concat [list $wire deconstruct_to $stream]]} --- 7223,7227 ---- lappend r #N canvas $@canvasx1 $@canvasy1 $@canvasxs $@canvasys if {$@subpatch} {lappend r $@name $@mapped} else {lappend r $@fontsize} ! $stream << "[philtre $r];\n" foreach child $@children {eval [concat [list $child deconstruct_to $stream]]} foreach wire $@wires {eval [concat [list $wire deconstruct_to $stream]]}