Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9462
Modified Files: Tag: devel_0_39 pd_base.tk pd_objects.tk Log Message: moved canvas 'methods' to canvas (not really methods yet)
Index: pd_objects.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/pd_objects.tk,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -C2 -d -r1.1.2.12 -r1.1.2.13 *** pd_objects.tk 14 Sep 2005 13:28:12 -0000 1.1.2.12 --- pd_objects.tk 17 Sep 2005 21:56:45 -0000 1.1.2.13 *************** *** 6,10 **** box img } ! defaults { x 1 y 1 ins 2 --- 6,10 ---- box img } ! attributes { x 1 y 1 ins 2 *************** *** 17,20 **** --- 17,27 ---- img "" } + hints { + color rgb + zero_x bool + zero_y bool + zs_x float 0.1 10 + zs_y float 0.1 10 + } init { $_ create rect 0 0 0 0 -tags [concat $tags box] *************** *** 39,43 **** } canvas { ! defaults { color {222 222 222} sc orange --- 46,50 ---- } canvas { ! attributes { color {222 222 222} sc orange *************** *** 49,53 **** canvas $_ place $_ -relwidth 1 -relheight 1 ! # bind $_ <Configure> "::pd::redraw $_ all" bind $_ <Enter> "focus $_" bind $_ <Key> "::pd::key $_ %k 1" --- 56,60 ---- canvas $_ place $_ -relwidth 1 -relheight 1 ! # bind $_ <Configure> "::pd::redraw $_ all" bind $_ <Enter> "focus $_" bind $_ <Key> "::pd::key $_ %k 1" *************** *** 75,81 **** $_ configure -bg $color -width [expr {[winfo width $_] + $bd}] -height [expr {[winfo height $_] + $bd}] } } gridlines { ! defaults { class gridlines stipple gray50 --- 82,320 ---- $_ configure -bg $color -width [expr {[winfo width $_] + $bd}] -height [expr {[winfo height $_] + $bd}] } + methods { + + proc sel {_ a x y} { + variable "" + switch $a { + first { + l $_ canvas sc + foreach xy {x y} {set ($_:c$xy) [set $xy];set ($_:f$xy) [set $xy]} + $_ create rect $($_:cx) $($_:cy) $($_:cx) $($_:cy) \ + -tags sel -fill "" -outline $sc -width 12} + release {$_ delete sel} + motion { + updatesel $_ [cleansel $_ [$_ find overlapping $($_:fx) $($_:fy) $x $y]] + $_ coords sel $($_:fx) $($_:fy) $x $y}}} + + proc getsel {_} { + variable "" + return [dict get $($_) canvas sel] + } + + proc item_pos {_ item r x y xx yy} { + update $_ $item $r [dict create x $x y $y xx $xx yy $yy] 1} + + proc pencil {_ a x y} { + variable "" + switch $a { + motion { + item_pos $_ $($_:ci) abs [tr $_ x i $x] [tr $_ y i $y] [tr $_ x i $($_:fx)] [tr $_ y i $y] + } + first {set ($_:ci) [item_new $_ [dict create type rect id - x 0 y 0 xx 0 yy 0 v 1]]}}} + + proc resize_canvas {_ a x y} {viewpoint $_ [dict create action resize x $x y $y]} + + proc item_v {_ a x y} { + variable "" + variable obj + foreach id [getsel $_] { + set type [dict get $($_) $id type] + if {[dict exists $obj $type defaults]} { + foreach local [dict keys [dict get $obj $type defaults]] { + set $local [dict get $obj $type defaults $local]}} + if {[dict exists $obj $type control Button-1]} {eval [dict get $obj $type control Button-1]} + } + } + + proc move_canvas {_ a x y} {viewpoint $_ [dict create action move x $x y $y]} + + proc move_object {_ a x y} { + variable "" + set mx [tr $_ x d [expr {$x - $($_:cx)}]] + set my [tr $_ y d [expr {$y - $($_:cy)}]] + foreach item [getsel $_] {item_pos $_ $item rel $mx $my $mx $my} + } + + proc resize_left {_ a x y} {item_resize $_ x $x $y} + proc resize_right {_ a x y} {item_resize $_ xx $x $y} + proc resize_top {_ a x y} {item_resize $_ y $x $y} + proc resize_bottom {_ a x y} {item_resize $_ yy $x $y} + proc resize_tl {_ a x y} {item_resize $_ x $x $y; item_resize $_ y $x $y} + proc resize_tr {_ a x y} {item_resize $_ x $x $y; item_resize $_ yy $x $y} + proc resize_bl {_ a x y} {item_resize $_ xx $x $y; item_resize $_ y $x $y} + proc resize_br {_ a x y} {item_resize $_ xx $x $y; item_resize $_ yy $x $y} + + proc item_resize {_ e x y} { + variable "" + array set ax {x x xx x y y yy y} + set m [tr $_ $ax($e) d [expr $$ax($e) - $($_:c$ax($e))]] + item_mua $_ rel [dict create $e $m] 1 + } + + + proc item_scale {_ a x y} { + + + } + proc cleansel {_ sel} { + set clean {} + foreach item $sel { + set class [lindex [$_ itemcget $item -tags] 0] + if {$class eq "item" || $class eq "cable"} {lappend clean [lindex [$_ itemcget $item -tags] 2]}} + set clean [lsort -unique $clean] + return $clean + } + + proc hover {_ x y} { + variable "" + if {[$_ find withtag sel] ne ""} { + sel $_ motion $x $y + } else { + set clicked [cleansel $_ [$_ find overlapping [expr $x - 2] [expr $y - 2] [expr $x + 2] [expr $y + 2]]] + if {$clicked ne ""} { + set c [lindex $clicked end] + resize_modes $_ $x $y $c + if {[llength [getsel $_]] <= 1} {updatesel $_ $c} + inspect $_ $c + } else { + mode $_ move_canvas + } + } + } + + proc resize_modes {_ x y id} { + variable "" + set d 3 + set bbox [$_ bbox [$_ find withtag "i$id && box"]] + if {$bbox eq ""} {set bbox {0 0 0 0}} + lassign $bbox bx by bxx byy + set dx [expr {abs($bx - $x)}] + set dxx [expr {abs($bxx - $x)}] + set dy [expr {abs($by - $y)}] + set dyy [expr {abs($byy - $y)}] + if {$dx < $d && $dy < $d} { + mode $_ resize_tl + } elseif {$dxx < $d && $dy < $d} { + mode $_ resize_tr + } elseif {$dx < $d && $dyy < $d} { + mode $_ resize_bl + } elseif {$dxx < $d && $dyy < $d} { + mode $_ resize_br + } elseif {$dx < 5} { + mode $_ resize_left + } elseif {$dxx < 5} { + mode $_ resize_right + } elseif {$dy < 1} { + mode $_ resize_top + } elseif {$dyy < 1} { + mode $_ resize_bottom + } else { + mode $_ move_object + } + } + + proc togglesel {_ d} { + variable "" + if {[lsearch [getsel $_] $d] < 0} { + set sel [concat [getsel $_] $d] + } else { + set sel [lsearch -inline -not -all [getsel $_] $d] + } + up $_ canvas sel + redraw $_ $d + } + + proc updatesel {_ sel} { + variable "" + set os [getsel $_] + up $_ canvas sel + redraw $_ [lsort -unique [concat $os $sel]] + } + + proc mode {_ m} { + variable "" + array set cursor {pencil pencil move_canvas fleur move_object dotbox item_v box_spiral resize_canvas bogosity sel cross_reverse item_scale sizing resize_left left_side resize_right right_side resize_top top_side resize_bottom bottom_side resize_tl top_left_corner resize_tr top_right_corner resize_bl bottom_left_corner resize_br bottom_right_corner} + set ($_:submode) $m + $_ configure -cursor $cursor($m) + } + proc mode_flip {_} { + variable "" + l $_ canvas mode + if {$mode eq "edit"} {set mode forward} {set mode edit} + up $_ canvas mode + redraw $_ {canvas grid} + } + + proc drop {_ dropped x y} { + foreach d [split $dropped "\n"] { + set x [tr $_ x i $x] + set y [tr $_ y i $y] + item_new $_ [dict create type sound id - g 1 v 1 x $x y $y xx $x yy $y filename [regsub -- {^file:[/]+} $d "/"]] + } + } + + + proc key {_ k b} { + # puts $k + switch $b { + 1 { + switch $k { + 9 {mode_flip $_} + 22 {item_delete $_} + 38 {clip $_ selecta} + 53 {clip $_ cut} + 54 {clip $_ copy} + 55 {clip $_ paste} + 97 {viewpoint $_ {action reset}} + 98 {viewpoint $_ {action scroll units -1 axis y}} + 100 {viewpoint $_ {action scroll units -1 axis x}} + 102 {viewpoint $_ {action scroll units 1 axis x}} + 104 {viewpoint $_ {action scroll units 1 axis y}} + 107 {item_delete $_} + } + } + } + } + + proc click {m button action _ x y X Y} { + variable "" + set clicked [cleansel $_ [$_ find overlapping $x $y $x $y]] + set a $($_:submode) + switch $action { + first { + foreach xy {x y} {set ($_:f$xy) [set $xy]} + switch $button { + 1 {if {$m eq "control"} { + mode $_ pencil; pencil $_ $action $x $y + } elseif {$m eq "double" || $m eq "shift"} { + if {[llength $clicked] > 0} { + togglesel $_ $clicked + } else { + sel $_ first $x $y + mode $_ sel + } + } elseif {[$_ find withtag sel] ne ""} { + sel $_ release $x $y + } elseif {[llength [getsel $_]] > 1 && [llength $clicked] > 0 && [lsearch [getsel $_] $clicked] == -1} { + updatesel $_ $clicked}} + 2 {if {$clicked ne ""} {mode $_ item_scale} {mode $_ resize_canvas}} + 3 {if {$clicked ne ""} {mode $_ item_v} {rmenu $_ $x $y $X $Y}}}} + motion {eval $a $_ $action $x $y} + release { + switch $button { + 1 {if {$a eq "draw" || ($a eq "sel" && [expr {abs($($_:fx) - $x)}] >13)} {eval $a $_ $action $x $y}} + 2 {mode $_ move_canvas} + 3 {mode $_ move_canvas} + } + } + } + if {$clicked ne ""} {inspect $_ [lindex $clicked end]} + foreach xy {x y} {set ($_:c$xy) [set $xy]} + } + } } + gridlines { ! attributes { class gridlines stipple gray50 *************** *** 111,115 **** box subwin } ! defaults { x 32 y 24 ins 1 --- 350,354 ---- box subwin } ! attributes { x 32 y 24 ins 1 *************** *** 133,140 **** } kbd { ! defaults { x 60 y 12 ! octaves 6 color {0 0 0} color_bg {255 255 255} --- 372,379 ---- } kbd { ! attributes { x 60 y 12 ! octaves 5 color {0 0 0} color_bg {255 255 255} *************** *** 146,150 **** set path [frame $_.$id] $_ create window 0 0 -tags [concat $tags subwin] -window $_.$id -anchor nw - # $path config -width [expr $octaves * 66] set bw {0 1 0 1 0 0 1 0 1 0 1 0} ; set npl {0 1 1 2 2 3 4 4 5 5 6 6} set keys [dict create 1 [dict create fg $color_bg bg $rgb rw 0.1 rh 0.6 an "-anchor n"] 0 [dict create fg $rgb bg $color_bg rw [expr 1 / 7.] rh 1. an "; lower $wk"]] --- 385,388 ---- *************** *** 169,173 **** } } ! proc { proc kbd_play {_ id m b x y} { l $_ $id lp --- 407,411 ---- } } ! methods { proc kbd_play {_ id m b x y} { l $_ $id lp *************** *** 198,202 **** box loc } ! defaults { x 10 y 10 ins 0 --- 436,440 ---- box loc } ! attributes { x 10 y 10 ins 0 *************** *** 215,219 ****
cable { ! defaults { class cable x 10 y 10 --- 453,457 ----
cable { ! attributes { class cable x 10 y 10 *************** *** 241,245 **** } ! proc { proc ioloc {p t id n io} { variable "" --- 479,483 ---- } ! methods { proc ioloc {p t id n io} { variable "" *************** *** 264,268 **** button { tags {box button} ! defaults {x 3 y 3 ins 1 outs 1} init { $_ create rect 0 0 0 0 -tags [concat $tags box] -width 0 --- 502,506 ---- button { tags {box button} ! attributes {x 3 y 3 ins 1 outs 1} init { $_ create rect 0 0 0 0 -tags [concat $tags box] -width 0 *************** *** 274,278 **** $_ coords $button $x $y $xx $yy } ! proc { proc button:flash {} { --- 512,516 ---- $_ coords $button $x $y $xx $yy } ! methods { proc button:flash {} { *************** *** 285,289 **** box txt } ! defaults { x 2 y 2 ins 1 --- 523,527 ---- box txt } ! attributes { x 2 y 2 ins 1 *************** *** 309,313 **** pos box } ! defaults { x 2 y 10 min 1 --- 547,551 ---- pos box } ! attributes { x 2 y 10 min 1 *************** *** 348,357 **** tl tlr tf tfr r w } ! defaults { ins 0 outs 0 } init { ! snack:::sound s$id set filename [dict get $($_) $id filename] s$id read $filename --- 586,595 ---- tl tlr tf tfr r w } ! attributes { ins 0 outs 0 } init { ! snack::sound s$id set filename [dict get $($_) $id filename] s$id read $filename
Index: pd_base.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/pd_base.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_base.tk 14 Sep 2005 13:28:12 -0000 1.1.2.9 --- pd_base.tk 17 Sep 2005 21:56:45 -0000 1.1.2.10 *************** *** 1,12 **** # Pure-Deleuzian ! # 2005 cdr (license of your choice) ! # an experimental canvas focusing on customizable 2d-object visualizations and editing ! # docs: http://whats-your.name/pd
set todo { ! draw io boxes ! scale selection ! objbox ! resize: shift square, shift-right corners }
--- 1,10 ---- # Pure-Deleuzian ! # 2005 cdr (BSD, EULA, GPL, MIT..) ! # http://whats-your.name/pd
set todo { ! io boxes ! scale selection, resize: shift square, shift-right corners ! reparent to toplevel }
*************** *** 22,27 **** # load object procs foreach type [dict keys $obj] { ! if {[dict exists $obj $type proc]} { ! eval [dict get $obj $type proc]}}
# omg the colours!! --- 20,25 ---- # load object procs foreach type [dict keys $obj] { ! if {[dict exists $obj $type methods]} { ! eval [dict get $obj $type methods]}}
# omg the colours!! *************** *** 49,53 **** 5 {return "$v $p $q"} default {error "i value $i is out of range"}}}} - # option add *borderWidth 0 widgetDefault option add *borderWidth 0 option add *font {{bitstream vera sans} 10} --- 47,50 ---- *************** *** 64,85 **** return $text}
- proc sel {_ a x y} { - variable "" - switch $a { - first { - l $_ canvas sc - foreach xy {x y} {set ($_:c$xy) [set $xy];set ($_:f$xy) [set $xy]} - $_ create rect $($_:cx) $($_:cy) $($_:cx) $($_:cy) \ - -tags sel -fill "" -outline $sc -width 12} - release {$_ delete sel} - motion { - updatesel $_ [cleansel $_ [$_ find overlapping $($_:fx) $($_:fy) $x $y]] - $_ coords sel $($_:fx) $($_:fy) $x $y}}} - proc item_new {_ a} { variable "" variable obj foreach local [dict keys $a] {set $local [dict get $a $local]} ! if {[dict exists $obj $type defaults]} {set da [dict get $obj $type defaults]} {set da {}} if {$id eq "-"} { if {[dict keys $($_)] eq ""} {set id 0} else {set id -1 --- 61,69 ---- return $text}
proc item_new {_ a} { variable "" variable obj foreach local [dict keys $a] {set $local [dict get $a $local]} ! if {[dict exists $obj $type attributes]} {set da [dict get $obj $type attributes]} {set da {}} if {$id eq "-"} { if {[dict keys $($_)] eq ""} {set id 0} else {set id -1 *************** *** 114,121 **** }
- proc getsel {_} { - variable "" - return [dict get $($_) canvas sel] - } proc item_delete {_ {items ""}} { variable "" --- 98,101 ---- *************** *** 131,142 **** dict unset ($_) $item dict set ($_) canvas sel {} - item_info $_ "" send "delete $_:$item" } }
- proc item_pos {_ item r x y xx yy} { - update $_ $item $r [dict create x $x y $y xx $xx yy $yy] 1} - proc update {_ item r u redraw} { variable "" --- 111,118 ---- *************** *** 172,184 **** }
- proc pencil {_ a x y} { - variable "" - switch $a { - motion { - item_pos $_ $($_:ci) abs [tr $_ x i $x] [tr $_ y i $y] [tr $_ x i $($_:fx)] [tr $_ y i $y] - } - first {set ($_:ci) [item_new $_ [dict create type rect id - x 0 y 0 xx 0 yy 0 v 1]]}}}
- proc resize_canvas {_ a x y} {viewpoint $_ [dict create action resize x $x y $y]}
proc redraw {_ items} { --- 148,152 ---- *************** *** 218,350 **** }
! proc item_v {_ a x y} { ! variable "" ! variable obj ! foreach id [getsel $_] { ! set type [dict get $($_) $id type] ! if {[dict exists $obj $type defaults]} { ! foreach local [dict keys [dict get $obj $type defaults]] { ! set $local [dict get $obj $type defaults $local]}} ! if {[dict exists $obj $type control Button-1]} {eval [dict get $obj $type control Button-1]} ! } ! } ! ! proc move_canvas {_ a x y} {viewpoint $_ [dict create action move x $x y $y]} ! ! proc move_object {_ a x y} { ! variable "" ! set mx [tr $_ x d [expr {$x - $($_:cx)}]] ! set my [tr $_ y d [expr {$y - $($_:cy)}]] ! foreach item [getsel $_] {item_pos $_ $item rel $mx $my $mx $my} ! } ! ! proc resize_left {_ a x y} {item_resize $_ x $x $y} ! proc resize_right {_ a x y} {item_resize $_ xx $x $y} ! proc resize_top {_ a x y} {item_resize $_ y $x $y} ! proc resize_bottom {_ a x y} {item_resize $_ yy $x $y} ! proc resize_tl {_ a x y} {item_resize $_ x $x $y; item_resize $_ y $x $y} ! proc resize_tr {_ a x y} {item_resize $_ x $x $y; item_resize $_ yy $x $y} ! proc resize_bl {_ a x y} {item_resize $_ xx $x $y; item_resize $_ y $x $y} ! proc resize_br {_ a x y} {item_resize $_ xx $x $y; item_resize $_ yy $x $y} ! ! proc item_resize {_ e x y} { ! variable "" ! array set ax {x x xx x y y yy y} ! set m [tr $_ $ax($e) d [expr $$ax($e) - $($_:c$ax($e))]] ! item_mua $_ rel [dict create $e $m] 1 ! } ! ! proc item_scale {_ a x y} { ! ! ! } ! proc cleansel {_ sel} { ! set clean {} ! foreach item $sel { ! set class [lindex [$_ itemcget $item -tags] 0] ! if {$class eq "item" || $class eq "cable"} {lappend clean [lindex [$_ itemcget $item -tags] 2]}} ! set clean [lsort -unique $clean] ! return $clean ! } ! ! proc hover {_ x y} { ! variable "" ! if {[$_ find withtag sel] ne ""} { ! sel $_ motion $x $y ! } else { ! set clicked [cleansel $_ [$_ find overlapping [expr $x - 2] [expr $y - 2] [expr $x + 2] [expr $y + 2]]] ! if {$clicked ne ""} { ! set c [lindex $clicked end] ! resize_modes $_ $x $y $c ! if {[llength [getsel $_]] <= 1} {updatesel $_ $c} ! inspect $_ $c ! } else { ! mode $_ move_canvas ! } ! } ! } ! ! proc resize_modes {_ x y id} { ! variable "" ! set d 3 ! set bbox [$_ bbox [$_ find withtag "i$id && box"]] ! if {$bbox eq ""} {set bbox {0 0 0 0}} ! lassign $bbox bx by bxx byy ! set dx [expr {abs($bx - $x)}] ! set dxx [expr {abs($bxx - $x)}] ! set dy [expr {abs($by - $y)}] ! set dyy [expr {abs($byy - $y)}] ! if {$dx < $d && $dy < $d} { ! mode $_ resize_tl ! } elseif {$dxx < $d && $dy < $d} { ! mode $_ resize_tr ! } elseif {$dx < $d && $dyy < $d} { ! mode $_ resize_bl ! } elseif {$dxx < $d && $dyy < $d} { ! mode $_ resize_br ! } elseif {$dx < 5} { ! mode $_ resize_left ! } elseif {$dxx < 5} { ! mode $_ resize_right ! } elseif {$dy < 1} { ! mode $_ resize_top ! } elseif {$dyy < 1} { ! mode $_ resize_bottom ! } else { ! mode $_ move_object ! } ! } ! ! proc item_info {_ clicked} { ! variable "" ! # return ! set n 0;$_ delete hover ! foreach item $clicked { ! set info "" ! set data [dict get $($_) $item] ! foreach d $data {lappend info [string range $d 0 7]} ! $_ create text [list [expr [winfo width $_] - 8.0] [expr [winfo height $_] - 8.0 - 11 * $n.0]] -fill [set [l $_ canvas sc]] -justify right -anchor se -font {{bitstream vera sans mono} 10} -tags hover -text $info ! incr n ! } ! } ! ! proc togglesel {_ d} { ! variable "" ! if {[lsearch [getsel $_] $d] < 0} { ! set sel [concat [getsel $_] $d] ! } else { ! set sel [lsearch -inline -not -all [getsel $_] $d] ! } ! up $_ canvas sel ! redraw $_ $d ! } ! ! proc updatesel {_ sel} { ! variable "" ! set os [getsel $_] ! up $_ canvas sel ! redraw $_ [lsort -unique [concat $os $sel]] ! item_info $_ $sel ! }
proc msg {} { --- 186,190 ---- }
!
proc msg {} { *************** *** 354,361 **** bind .msg.text <KeyPress-Return> {::pd::send [.msg.text get]}}}
- proc flatten {p} { - return [regsub -- "." $p "_"] - } - proc colors {} { variable "" --- 194,197 ---- *************** *** 363,367 **** if {![winfo exists $p]} { toplevel $p ! # yes this should be generated algorithmically and will be when i get aroud to it, god willing set picker {iVBORw0KGgoAAAANSUhEUgAAADIAAAEACAIAAAB+mLL0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QkNDBMQBB81AgAAELhJREFUeNqtnVty47wOhMGL/5nZ29n/ZkYiz0MsBQTQTciZFMulyE7SISEQpPAJ5X+//vwq5Xcpv0R+lfKrlF9S3mfWk+8z7w/I9VPfJ0VE/vyWP3+u9vz49/u4i5S1VXcm30TkJfIS6SJdHbTrtYnU67Vef666XyJdna0JifzMLesWZDR5ZV5TQbLIAX9XyzLKjLiKO+zdW0W9Hb5uP3C/ish/So1pXlMFNvPuLfPb/UHyPO8tPYJkEEWk9PW3k+PMW8a2Xq63qustYwN2EMNG3qpUVqcmH16PgcmT1nKy2g8GMXYQhepoT94Ke4ubfCEmX9xfMgfJ86KsKuMgYu9wm3w4Iua14bfCQbxNPuNOa3IQ2+4gPCngMkSTjxlK8X7LKPMiMmfCySe0emRbonurAF/QHrakrL2j7wkRPX0yM4hZ26q0n3p0jE7KqsmYfM9pKsjkvQ0ZQf5Vywp7y49gI+a17a0GBIXfEtvKmJdok/futOGu0jr8MZKVMfZqTB4NorGwUIpp4gzLdGfo5X80iHd75WT13Wwd9hk0+XAQSXs5WX1n8j4GrGiJUaPJ2BtWKOgVyQobCdfYILbdZWg0mVfBV8a2w77DB2TyFbuuUJmXhXxbo0HzxuRD22pg+JAsNBm0TDhv1ol5w3+5BbSXxceu5YNmHiCgK/Gr/Sci+JdUoK/wdaKPzb2aBgR9abp7KxNL7oPmgoNmYmGvSJyAYB8tCB4ENuY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HqAPBTky4hMNFVXWt2ElzPwRVcEVzcpjg1RiYk9xtoI80CSi4XWgkLVTaIOBn4raeBCmQdS3aTy9C0SQZA178RlRDgIVVWhmUqS3UKTLyuQgazbZ6oLrbhSHAw7IezTvy8Hg2JkKhp4WZkyIqFVDR9BmAInvrpJwfWE7l/ad7BfxZCIK47Sv7P4x8qrnLiTJCptMunYabqnrVMwHESfWHrm4CxfRiTUpKMjQ4hMZPIjwatwNaSMiIFEzohdiR3EjJCaJDM2qayKIZG2oci6xUOIE/eZ6qaSiFADPylZYIPmuSZbI0IkrHEyVs5LsCZCiESlHjosbeI9gsdDmgNXw13rAxMig0w+BdfrEIyHNFeWQvD+3bmK47WPvoNmZNeC8ZDhjmW3obi1LTuIxC9k7tecFFzpbgTPZGATdlXBpU0KKJOr99ANHnImAKTFnRo8RKIyRxVDIkjW37WYSE+CWuhKJIQIv6skUSGYYzeIk5i8L23imYyxu58kyiMcuAhForpJ5OU9ITLWYJfcRjL3ro6IEDn39dH6stw2f2ZGKDu/h6TvE/kaIueucs4SNIvdjNvfzhIqy/M0B74GB4+3kne0yAfE3YHJ1IKJXPf/ARXN6/ssS+vjAAAAAElFTkSuQmCC} image create photo colorpicker --- 199,203 ---- if {![winfo exists $p]} { toplevel $p ! # yes this will be generated algorithmically one day, god willing set picker {iVBORw0KGgoAAAANSUhEUgAAADIAAAEACAIAAAB+mLL0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QkNDBMQBB81AgAAELhJREFUeNqtnVty47wOhMGL/5nZ29n/ZkYiz0MsBQTQTciZFMulyE7SISEQpPAJ5X+//vwq5Xcpv0R+lfKrlF9S3mfWk+8z7w/I9VPfJ0VE/vyWP3+u9vz49/u4i5S1VXcm30TkJfIS6SJdHbTrtYnU67Vef666XyJdna0JifzMLesWZDR5ZV5TQbLIAX9XyzLKjLiKO+zdW0W9Hb5uP3C/ish/So1pXlMFNvPuLfPb/UHyPO8tPYJkEEWk9PW3k+PMW8a2Xq63qust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IKJXPf/ARXN6/ssS+vjAAAAAElFTkSuQmCC} image create photo colorpicker *************** *** 425,463 **** $p.${k}v insert 0 [dict get $($_) $id $k]}}
! proc click {m button action _ x y X Y} { ! variable "" ! set clicked [cleansel $_ [$_ find overlapping $x $y $x $y]] ! set a $($_:submode) ! switch $action { ! first { ! foreach xy {x y} {set ($_:f$xy) [set $xy]} ! switch $button { ! 1 {if {$m eq "control"} { ! mode $_ pencil; pencil $_ $action $x $y ! } elseif {$m eq "double" || $m eq "shift"} { ! if {[llength $clicked] > 0} { ! togglesel $_ $clicked ! } else { ! sel $_ first $x $y ! mode $_ sel ! } ! } elseif {[$_ find withtag sel] ne ""} { ! sel $_ release $x $y ! } elseif {[llength [getsel $_]] > 1 && [llength $clicked] > 0 && [lsearch [getsel $_] $clicked] == -1} { ! updatesel $_ $clicked}} ! 2 {if {$clicked ne ""} {mode $_ item_scale} {mode $_ resize_canvas}} ! 3 {if {$clicked ne ""} {mode $_ item_v} {rmenu $_ $x $y $X $Y}}}} ! motion {eval $a $_ $action $x $y} ! release { ! switch $button { ! 1 {if {$a eq "draw" || ($a eq "sel" && [expr {abs($($_:fx) - $x)}] >13)} {eval $a $_ $action $x $y}} ! 2 {mode $_ move_canvas} ! 3 {mode $_ move_canvas} ! } ! } ! } ! if {$clicked ne ""} {inspect $_ [lindex $clicked end]} ! foreach xy {x y} {set ($_:c$xy) [set $xy]} ! }
proc rmenu {_ x y X Y} { --- 261,265 ---- $p.${k}v insert 0 [dict get $($_) $id $k]}}
!
proc rmenu {_ x y X Y} { *************** *** 589,598 **** }
! proc mode {_ m} { ! variable "" ! array set cursor {pencil pencil move_canvas fleur move_object dotbox item_v box_spiral resize_canvas bogosity sel cross_reverse item_scale sizing resize_left left_side resize_right right_side resize_top top_side resize_bottom bottom_side resize_tl top_left_corner resize_tr top_right_corner resize_bl bottom_left_corner resize_br bottom_right_corner} ! set ($_:submode) $m ! $_ configure -cursor $cursor($m) ! }
proc item_mua {_ r u redraw {items -}} { --- 391,395 ---- }
!
proc item_mua {_ r u redraw {items -}} { *************** *** 601,646 **** foreach item $items {update $_ $item $r $u $redraw} } ! ! proc mode_flip {_} { ! variable "" ! l $_ canvas mode ! if {$mode eq "edit"} {set mode forward} {set mode edit} ! up $_ canvas mode ! redraw $_ {canvas grid} ! } ! ! proc key {_ k b} { ! # puts $k ! switch $b { ! 1 { ! switch $k { ! 9 {mode_flip $_} ! 22 {item_delete $_} ! 38 {clip $_ selecta} ! 53 {clip $_ cut} ! 54 {clip $_ copy} ! 55 {clip $_ paste} ! 97 {viewpoint $_ {action reset}} ! 98 {viewpoint $_ {action scroll units -1 axis y}} ! 100 {viewpoint $_ {action scroll units -1 axis x}} ! 102 {viewpoint $_ {action scroll units 1 axis x}} ! 104 {viewpoint $_ {action scroll units 1 axis y}} ! 107 {item_delete $_} ! } ! } ! } ! } ! ! proc drop {_ dropped x y} { ! foreach d [split $dropped "\n"] { ! set x [tr $_ x i $x] ! set y [tr $_ y i $y] ! item_new $_ [dict create type sound id - g 1 v 1 x $x y $y xx $x yy $y filename [regsub -- {^file:[/]+} $d "/"]] ! } ! } ! proc new {_} { variable "" ! variable obj if {[info exists ($_)] != 1} {set ($_) {}} if {[winfo exists $_] != 1} { --- 398,406 ---- foreach item $items {update $_ $item $r $u $redraw} } ! ! proc new {_} { variable "" ! variable obj if {[info exists ($_)] != 1} {set ($_) {}} if {[winfo exists $_] != 1} { *************** *** 654,659 **** proc connect {} { if {[catch {set pd_send [socket localhost 4400]}]} {set pd_send -1} {puts "connected $pd_send"} ! catch {set pd_receive [socket -server ::pd::receive_conn 4401]} ! } proc receive_conn {s addr port} { fileevent $s readable [list ::pd::receive $s] --- 414,418 ---- proc connect {} { if {[catch {set pd_send [socket localhost 4400]}]} {set pd_send -1} {puts "connected $pd_send"} ! catch {set pd_receive [socket -server ::pd::receive_conn 4401]}} proc receive_conn {s addr port} { fileevent $s readable [list ::pd::receive $s] *************** *** 684,686 **** --- 443,446 ---- toplevel .c -width 512 -height 512 ::pd::new .c.c + #connect }