Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23448
Modified Files: Tag: desiredata desire.tk Log Message: renamed @undo_q,@redo_q to @undo_stack,@redo_stack
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.148 retrieving revision 1.1.2.600.2.149 diff -C2 -d -r1.1.2.600.2.148 -r1.1.2.600.2.149 *** desire.tk 2 Jan 2007 13:30:17 -0000 1.1.2.600.2.148 --- desire.tk 3 Jan 2007 00:29:55 -0000 1.1.2.600.2.149 *************** *** 311,324 **** def History init {} { super ! set @undo_q {} ! set @redo_q {} }
! def History can_undo? {} {return [expr [llength @undo_q] > 0]} ! def History can_redo? {} {return [expr [llength @redo_q] > 0]} def History next_undo_name {} {return stuff} def History next_redo_name {} {return stuff} ! def History undo_q {} {return $@undo_q} ! def History redo_q {} {return $@redo_q}
# overload this if you want to control how many levels --- 311,324 ---- def History init {} { super ! set @undo_stack {} ! set @redo_stack {} }
! def History can_undo? {} {return [expr [llength @undo_stack] > 0]} ! def History can_redo? {} {return [expr [llength @redo_stack] > 0]} def History next_undo_name {} {return stuff} def History next_redo_name {} {return stuff} ! def History undo_stack {} {return $@undo_stack} ! def History redo_stack {} {return $@redo_stack}
# overload this if you want to control how many levels *************** *** 326,337 **** # keep in mind that undo information is kept hierarchically. def History add {message} { ! lappend @undo_q [list do $message [lrange [info level -3] 1 end]] ! set @redo_q {} $self changed }
def History can't {} { ! lappend @undo_q [list can't {} [lrange [info level -3] 1 end]] ! set @redo_q {} $self changed } --- 326,337 ---- # keep in mind that undo information is kept hierarchically. def History add {message} { ! lappend @undo_stack [list do $message [lrange [info level -3] 1 end]] ! set @redo_stack {} $self changed }
def History can't {} { ! lappend @undo_stack [list can't {} [lrange [info level -3] 1 end]] ! set @redo_stack {} $self changed } *************** *** 340,351 **** def History undo {} { global errorInfo ! if {![$self can_perform? [lindex $@undo_q end]]} {error "Can't undo this!"} ! set backup $@undo_q ! set @undo_q $@redo_q ! set @redo_q {} #set err [catch {$self perform [lindex $backup end]}]; if {$err} {set err $errorInfo} $self perform [lindex $backup end] ! set @redo_q $@undo_q ! set @undo_q [lrange $backup 0 end-1] $self changed #if {$err} {post %s $err; error "undo: $err"} --- 340,351 ---- def History undo {} { global errorInfo ! if {![$self can_perform? [lindex $@undo_stack end]]} {error "Can't undo this!"} ! set backup $@undo_stack ! set @undo_stack $@redo_stack ! set @redo_stack {} #set err [catch {$self perform [lindex $backup end]}]; if {$err} {set err $errorInfo} $self perform [lindex $backup end] ! set @redo_stack $@undo_stack ! set @undo_stack [lrange $backup 0 end-1] $self changed #if {$err} {post %s $err; error "undo: $err"} *************** *** 354,363 **** def History redo {} { global errorInfo ! if {![$self can_perform? [lindex $@undo_q end]]} {error "Can't redo this!"} ! set backup $@redo_q ! set @redo_q {} set err [catch {$self perform [lindex $backup end]}]; if {$err} {set err $errorInfo} $self perform [lindex $backup end] ! set @redo_q [lrange $backup 0 end-1] $self changed #if {$err} {post %s $err; error "redo: $err"} --- 354,363 ---- def History redo {} { global errorInfo ! if {![$self can_perform? [lindex $@undo_stack end]]} {error "Can't redo this!"} ! set backup $@redo_stack ! set @redo_stack {} set err [catch {$self perform [lindex $backup end]}]; if {$err} {set err $errorInfo} $self perform [lindex $backup end] ! set @redo_stack [lrange $backup 0 end-1] $self changed #if {$err} {post %s $err; error "redo: $err"} *************** *** 387,398 **** def History atomically {what code} { global errorInfo ! set ubackup @undo_q; set @undo_q {} ! set rbackup @redo_q; set @redo_q {} set err [catch {uplevel 2 $code}] if {$err} {set err $errorInfo; puts "errorinfo :::: $errorInfo"} ! set atom $@undo_q ! set @undo_q $ubackup ! set @redo_q $rbackup ! lappend @undo_q [list $what $atom [lrange [info level -3] 1 end]] $self changed if {$err} {puts %s $err; error "atomically: $err"} --- 387,398 ---- def History atomically {what code} { global errorInfo ! set ubackup @undo_stack; set @undo_stack {} ! set rbackup @redo_stack; set @redo_stack {} set err [catch {uplevel 2 $code}] if {$err} {set err $errorInfo; puts "errorinfo :::: $errorInfo"} ! set atom $@undo_stack ! set @undo_stack $ubackup ! set @redo_stack $rbackup ! lappend @undo_stack [list $what $atom [lrange [info level -3] 1 end]] $self changed if {$err} {puts %s $err; error "atomically: $err"} *************** *** 440,444 **** icon_downarrow 7 5 "0,127,62,28,8" } { - puts "create bitmap $name" image create bitmap $name -data "#define z_width $w\n#define z_height $h static unsigned char z_bits[] = { $values };" --- 440,443 ---- *************** *** 7579,7584 **** def HistoryDialog notice {args} { .$self.list delete 0 end ! set hist [concat [$@history undo_q] [list "You Are Here"] [lreverse [$@history redo_q]]] ! set k [llength [$@history undo_q]] set i 0 foreach e $hist { --- 7578,7583 ---- def HistoryDialog notice {args} { .$self.list delete 0 end ! set hist [concat [$@history undo_stack] [list "You Are Here"] [lreverse [$@history redo_stack]]] ! set k [llength [$@history undo_stack]] set i 0 foreach e $hist {