Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19571
Modified Files: Tag: devel_0_39 desire.tk Log Message: class names should be uppercased
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.154 retrieving revision 1.1.2.155 diff -C2 -d -r1.1.2.154 -r1.1.2.155 *** desire.tk 15 Apr 2006 22:34:24 -0000 1.1.2.154 --- desire.tk 16 Apr 2006 06:15:33 -0000 1.1.2.155 *************** *** 49,71 **** # attributes (maybe all) have changed.
! class_new observable {} ! def observable init {} { set @subscribers {} } ! def observable subscribe {observer} { set i [lsearch $@subscribers $observer] if {$i<0} {lappend @subscribers $observer} } ! def observable unsubscribe {observer} { set i [lsearch $@subscribers $observer] if {$i>=0} {set @subscribers [lreplace $@subscribers $i $i]} } ! def observable changed {args} { foreach x $@subscribers {eval [concat [list $x notice $self] $args]} } ! def observable child_changed {origin args} { foreach x $@subscribers {eval [concat [list $x notice $origin] $args]} } ! def observable subscribers {} {return $@subscribers}
#-----------------------------------------------------------------------------------# --- 49,71 ---- # attributes (maybe all) have changed.
! class_new Observable {} ! def Observable init {} { set @subscribers {} } ! def Observable subscribe {observer} { set i [lsearch $@subscribers $observer] if {$i<0} {lappend @subscribers $observer} } ! def Observable unsubscribe {observer} { set i [lsearch $@subscribers $observer] if {$i>=0} {set @subscribers [lreplace $@subscribers $i $i]} } ! def Observable changed {args} { foreach x $@subscribers {eval [concat [list $x notice $self] $args]} } ! def Observable child_changed {origin args} { foreach x $@subscribers {eval [concat [list $x notice $origin] $args]} } ! def Observable subscribers {} {return $@subscribers}
#-----------------------------------------------------------------------------------# *************** *** 73,84 **** array unset poolset foo
! class_new manager {thing}
! def* manager init {} { set @q [list] $self call }
! def manager call {} { global poolset if {[llength $@q]} {post "client queue %d" [llength $@q]} --- 73,84 ---- array unset poolset foo
! class_new Manager {thing}
! def* Manager init {} { set @q [list] $self call }
! def Manager call {} { global poolset if {[llength $@q]} {post "client queue %d" [llength $@q]} *************** *** 93,100 **** }
! def* manager notice {origin args} { global poolset if {[info exists poolset($origin)]} { ! post %s "def manager notice: double dirty" # nothing for now } { --- 93,100 ---- }
! def* Manager notice {origin args} { global poolset if {[info exists poolset($origin)]} { ! post %s "def Manager notice: double dirty" # nothing for now } { *************** *** 102,106 **** lappend @q $origin } ! post "manager notice: queue length is now %d" [llength $@q] }
--- 102,106 ---- lappend @q $origin } ! post "Manager notice: queue length is now %d" [llength $@q] }
*************** *** 477,481 **** ################ utility functions #########################
! proc pdtk_post {s} {post $s}
proc enquote {x} { --- 477,481 ---- ################ utility functions #########################
! proc pdtk_post {s} {regsub -- "\n$" $s "" s; post %s $s}
proc enquote {x} { *************** *** 757,761 ****
#-----------------------------------------------------------------------------------# ! class_new view {observable thing}
# normally ninlets/noutlets should be in class "box", but server-side isn't smart enough --- 757,761 ----
#-----------------------------------------------------------------------------------# ! class_new view {Observable thing}
# normally ninlets/noutlets should be in class "box", but server-side isn't smart enough *************** *** 2994,2998 **** set oldpos [lindex [.log.2 get] 1] .log.1 insert end $x ! regsub "\n$" $x "" y set n [expr [string length $x]-[string length $y]] set console_lines [expr $console_lines+$n] --- 2994,2998 ---- set oldpos [lindex [.log.2 get] 1] .log.1 insert end $x ! regsub -all "\n" $x "" y set n [expr [string length $x]-[string length $y]] set console_lines [expr $console_lines+$n] *************** *** 3640,3644 **** #c lsort proably does what u want (has an integer flag too)
! set manager [manager_new]
proc post_hierarchy {self {i 0}} { --- 3640,3644 ---- #c lsort proably does what u want (has an integer flag too)
! set manager [Manager_new]
proc post_hierarchy {self {i 0}} {