Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9772
Modified Files:
Tag: impd_0_37
g_all_guis.c g_bang.c g_editor.c g_hdial.c g_hslider.c
g_numbox.c g_rtext.c g_text.c g_toggle.c g_vumeter.c u_main.tk
u_object.tk
Log Message:
more bugfixes, and a prototype of Tcl-side wire creation
Index: g_toggle.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_toggle.c,v
retrieving revision 1.1.1.3.2.2.2.10
retrieving revision 1.1.1.3.2.2.2.11
diff -C2 -d -r1.1.1.3.2.2.2.10 -r1.1.1.3.2.2.2.11
*** g_toggle.c 7 Apr 2004 03:17:40 -0000 1.1.1.3.2.2.2.10
--- g_toggle.c 8 Apr 2004 10:48:12 -0000 1.1.1.3.2.2.2.11
***************
*** 31,36 ****
sys_mgui((t_iemgui *)x,"toggle","select","i",x->x_gui.x_fsf.x_selected);
else {
! pd_upload((t_gobj *)x);
! pd_upload2((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"toggle","draw","");
if(glist_isvisible(glist)) sys_mgui((t_iemgui *)x,"toggle","set","i",x->x_on!=0.0);
--- 31,35 ----
sys_mgui((t_iemgui *)x,"toggle","select","i",x->x_gui.x_fsf.x_selected);
else {
! pd_upload((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"toggle","draw","");
if(glist_isvisible(glist)) sys_mgui((t_iemgui *)x,"toggle","set","i",x->x_on!=0.0);
Index: g_text.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_text.c,v
retrieving revision 1.1.1.4.2.2.2.10
retrieving revision 1.1.1.4.2.2.2.11
diff -C2 -d -r1.1.1.4.2.2.2.10 -r1.1.1.4.2.2.2.11
*** g_text.c 7 Apr 2004 03:17:40 -0000 1.1.1.4.2.2.2.10
--- g_text.c 8 Apr 2004 10:48:11 -0000 1.1.1.4.2.2.2.11
***************
*** 1058,1063 ****
text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2);
ob = pd_checkobject(&x->te_pd);
! pd_upload((t_gobj *)x);
! pd_upload2((t_gobj *)x,glist);
sys_vgui("%s_draw %x .x%x.c %d %d %d %d\n",
text_classname(x),x,glist_getcanvas(glist),x2-x1,y2-y1,
--- 1058,1062 ----
text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2);
ob = pd_checkobject(&x->te_pd);
! pd_upload((t_gobj *)x,glist);
sys_vgui("%s_draw %x .x%x.c %d %d %d %d\n",
text_classname(x),x,glist_getcanvas(glist),x2-x1,y2-y1,
***************
*** 1067,1076 ****
void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag)
{
! sys_vgui("io_erase %s .x%x.c\n",tag,glist_getcanvas(glist));
}
void text_eraseborder(t_text *x, t_glist *glist, char *tag)
{
! sys_vgui("%s_erase %s .x%x.c\n", text_classname(x), tag,glist_getcanvas(glist));
sys_vgui("io_erase %s .x%x.c\n",tag,glist_getcanvas(glist));
}
--- 1066,1075 ----
void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag)
{
! sys_vgui("io_erase %x .x%x.c\n",ob,glist_getcanvas(glist));
}
void text_eraseborder(t_text *x, t_glist *glist, char *tag)
{
! sys_vgui("%s_erase %s .x%x.c\n", text_classname(x), tag, glist_getcanvas(glist));
sys_vgui("io_erase %s .x%x.c\n",tag,glist_getcanvas(glist));
}
Index: g_hdial.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v
retrieving revision 1.1.1.4.2.2.2.10
retrieving revision 1.1.1.4.2.2.2.11
diff -C2 -d -r1.1.1.4.2.2.2.10 -r1.1.1.4.2.2.2.11
*** g_hdial.c 7 Apr 2004 03:17:40 -0000 1.1.1.4.2.2.2.10
--- g_hdial.c 8 Apr 2004 10:48:11 -0000 1.1.1.4.2.2.2.11
***************
*** 41,46 ****
sys_mgui((t_iemgui *)x,"radio","select","i",x->x_gui.x_fsf.x_selected);
} else {
! pd_upload((t_gobj *)x);
! pd_upload2((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"radio","draw","");
sys_mgui((t_iemgui *)x,"radio","set","i",x->x_on);
--- 41,45 ----
sys_mgui((t_iemgui *)x,"radio","select","i",x->x_gui.x_fsf.x_selected);
} else {
! pd_upload((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"radio","draw","");
sys_mgui((t_iemgui *)x,"radio","set","i",x->x_on);
Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.1.1.4.2.7.4.36
retrieving revision 1.1.1.4.2.7.4.37
diff -C2 -d -r1.1.1.4.2.7.4.36 -r1.1.1.4.2.7.4.37
*** u_main.tk 7 Apr 2004 05:15:38 -0000 1.1.1.4.2.7.4.36
--- u_main.tk 8 Apr 2004 10:48:12 -0000 1.1.1.4.2.7.4.37
***************
*** 28,31 ****
--- 28,33 ----
#option add *activeForeground #ffffff
+ proc l+ {al bl} {set r {}; foreach a $al b $bl {lappend r [expr $a+$b]}; return $r}
+
# there are two palettes of 30 colours used in Pd
# when placed in a 3*10 grid, the difference is that
***************
*** 537,541 ****
global _
if {[info exists _($tag:class)]} {set class $_($tag:class)} {set class unknown}
! $self.stat.what configure -text "$tag \[$class\]"
return
}
--- 539,543 ----
global _
if {[info exists _($tag:class)]} {set class $_($tag:class)} {set class unknown}
! $self.stat.what configure -text "$tag \[$class\] ($tags)"
return
}
***************
*** 566,574 ****
label $name.stat.pos -width 12 -font {courier 9} \
-background #cccccc -foreground black
! label $name.stat.what -width 32 -font {courier 9} -anchor w \
-background #cccccc -foreground black
pack $name.stat.pos -side left
pack $name.stat.what -side left -padx 8
! pack $name.stat -side bottom -fill x -expand no
}
pack $name.scrollhort -side bottom -fill x
--- 568,576 ----
label $name.stat.pos -width 12 -font {courier 9} \
-background #cccccc -foreground black
! label $name.stat.what -width 40 -font {courier 9} -anchor w \
-background #cccccc -foreground black
pack $name.stat.pos -side left
pack $name.stat.what -side left -padx 8
! pack $name.stat -side bottom -fill x
}
pack $name.scrollhort -side bottom -fill x
***************
*** 781,815 ****
}
proc pdtk_canvas_click {canvas x y b f} {
set cx [$canvas canvasx $x]
set cy [$canvas canvasy $y]
pd [canvastosym $canvas] mouse $cx $cy $b $f \;
! set stack [$canvas find overlapping [expr $cx-2] [expr $cy-2] [expr $cx+2] [expr $cy+2]]
! set tags [$canvas gettags [lindex $stack end]]
! puts stderr "(click) $canvas $cx $cy $b $f : $tags "
! if {[regexp {^([a-f0-9]{7})} $tags tag] ||
! [regexp {^\.x[a-f0-9]+\.t([a-f0-9]{7})} $tags tag]} {
! global _
! if {[info exists _($tag:class)]} {set class $_($tag:class)} {set class unknown}
! puts stderr "(.....) $tag is a \[$class\] object"
! if {[llength [$canvas bbox ${tag}BASE]]} {
! foreach {x1 y1 x2 y2} [$canvas bbox ${tag}BASE] {}
! post "x=$cx y=$cy x1=$x1 y1=$y1 x2=$x2 y2=$y2"
! } {
! post "BASEless object?"
}
! pd "[canvastosym $canvas] click-on-object $tag $cx $cy $b $f;"
! return
}
! if {[regexp {^l([a-f0-9]{7})} $tags tag]} {
! puts stderr "(.....) this is a wire"
! pd "[canvastosym $canvas] click-on-wire $tag $cx $cy $b $f;"
! return
}
- puts stderr "(.....) nothing in particular"
}
proc pdtk_start_wire {canvas x y b f} {
! if (ob && (noutlet = obj_noutlets(ob)) && ypos >= y2-4) {} {return}
# width = x2-x1
# nout1 = noutlet>1 ? noutlet-1 : 1
--- 783,881 ----
}
+ proc identify_target {canvas cx cy b f label} {
+ set stack [$canvas find overlapping [expr $cx-2] [expr $cy-2] [expr $cx+2] [expr $cy+2]]
+ set tags [$canvas gettags [lindex $stack end]]
+ #puts stderr "($label) $canvas $cx $cy $b $f : $tags "
+ if {[regexp {^([a-f0-9]{7})} $tags tag]} {
+ global _
+ if {[info exists _($tag:class)]} {set class $_($tag:class)} {set class unknown}
+ #puts stderr "(.....) $tag is a \[$class\] object"
+ return [list "object" $tag]
+ }
+ if {[regexp {^l([a-f0-9]{7})} $tags tag]} {
+ #puts stderr "(.....) this is a wire"
+ return [list "wire" $tag]
+ }
+ #puts stderr "(.....) nothing in particular"
+ return [list "nothing"]
+ }
+
proc pdtk_canvas_click {canvas x y b f} {
+ global _
+ set self [canvastosym $canvas]
set cx [$canvas canvasx $x]
set cy [$canvas canvasy $y]
pd [canvastosym $canvas] mouse $cx $cy $b $f \;
! foreach {type tag} [identify_target $canvas $x $y $b $f "click"] {}
! switch $type {
! object {
! pd "$self click-on-object $tag $cx $cy $b $f;"
! if {$_($self:mode)=="edit" && [llength [$canvas bbox ${tag}BASE]]} {
! foreach {x1 y1 x2 y2} [$canvas bbox ${tag}BASE] {}
! if {abs($y2-1-$cy)<=3} {
! set out [expr int(($cx-$x1)*$_($tag:outlets)/($x2-$x1))]
! foreach {ox1 oy1 ox2 oy2} [$canvas bbox ${tag}o${out}] {}
! wire_draw lnew $canvas 1 $cx $cy $cx $cy
! $canvas itemconfigure lnew -dash "4 4 4 4"
}
! }
! }
! wire {
! pd "[canvastosym $canvas] click-on-wire $tag $cx $cy $b $f;"
! }
}
! }
!
! set dehighlight {}
!
! proc pdtk_canvas_motion {canvas x y mods} {
! global current_x current_y tooltip _ dehighlight look
! set cx [$canvas canvasx $x]
! set cy [$canvas canvasy $y]
! if {$tooltip(visible)} {
! #puts "cx=$cx cy=$cy tooltip=($tooltip(mx),$tooltip(my),$tooltip(canvas),$tooltip(visible)"
! if {[expr pow($tooltip(mx)-$cx,2) + pow($tooltip(my)-$cy,2) > 100]} {
! hide_canvas_tooltip $tooltip(canvas)
! }
! }
! eval $dehighlight
! set dehighlight {}
! set current_x $cx
! set current_y $cy
! pd [canvastosym $canvas] motion $x $y $mods \;
! foreach {type tag} [identify_target $canvas $x $y -1 -1 "move "] {}
! switch $type {
! object {
! if {[llength [$canvas bbox ${tag}BASE]]} {
! foreach {x1 y1 x2 y2} [$canvas bbox ${tag}BASE] {}
! post "cx=$cx cy=$cy x1=$x1 y1=$y1 x2=$x2 y2=$y2"
! if {abs($y2-1-$cy)<=3} {
! set out [expr int(($cx-$x1)*$_($tag:outlets)/($x2-$x1))]
! $canvas create rectangle \
! [l+ [$canvas coords ${tag}o${out}] {-4 -4 +4 +4}] \
! -outline $look(outletfg) -width 1 -tags ${tag}o${out}b
! set dehighlight "$canvas delete ${tag}o${out}b"
! }
! } {
! post "BASEless object?"
! }
! }
! wire {}
! }
! if {[llength [$canvas gettags lnew]]} {
! #foreach {ox1 oy1 ox2 oy2} [$canvas coords lnew] {}
! #$canvas coords lnew $ox1 $oy1 $cx $cy
! foreach {ox1 oy1 ox2 oy2} [lrange [$canvas coords lnew] end-3 end] {}
! set l [$canvas coords lnew]
! if {[llength $l]<4 || pow($ox1-$cx,2)+pow($oy1-$cy,2)<pow(30,2)} {
! set l [lrange $l 0 [expr [llength $l]-3]]
! }
! lappend l $cx $cy
! $canvas coords lnew $l
}
}
proc pdtk_start_wire {canvas x y b f} {
! # if (ob && (noutlet = obj_noutlets(ob)) && ypos >= y2-4) {} {return}
# width = x2-x1
# nout1 = noutlet>1 ? noutlet-1 : 1
***************
*** 861,864 ****
--- 927,932 ----
}
pdtk_canvas_checkgeometry [canvastosym $name]
+ set canvas $name
+ if {[llength [$canvas gettags lnew]]} {$canvas delete lnew}
}
***************
*** 933,950 ****
set current_y 0
#set current_canvas foo
- proc pdtk_canvas_motion {canvas x y mods} {
- global current_x current_y tooltip
- set x [$canvas canvasx $x]
- set y [$canvas canvasx $y]
- if {$tooltip(visible)} {
- puts "x=$x y=$y tooltip=($tooltip(mx),$tooltip(my),$tooltip(canvas),$tooltip(visible)"
- if {[expr pow($tooltip(mx)-$x,2) + pow($tooltip(my)-$y,2) > 100]} {
- hide_canvas_tooltip $tooltip(canvas)
- }
- }
- set current_x $x
- set current_y $y
- pd [canvastosym $canvas] motion $x $y $mods \;
- }
# "map" event tells us when the canvas becomes visible (arg is "0") or
--- 1001,1004 ----
***************
*** 1203,1207 ****
wm protocol $id WM_DELETE_WINDOW "dogatom_cancel $id"
global properties
! properties_dialog $self dogatom_ok $properties(gatom)
foreach name {hi lo width} {
bind $id.$name.entry <KeyPress-Return> "dogatom_ok $id"
--- 1257,1261 ----
wm protocol $id WM_DELETE_WINDOW "dogatom_cancel $id"
global properties
! properties_dialog $self .$self dogatom_ok $properties(gatom)
foreach name {hi lo width} {
bind $id.$name.entry <KeyPress-Return> "dogatom_ok $id"
***************
*** 1598,1610 ****
# check or uncheck the "edit" menu item
proc pdtk_canvas_editval {name value} {
! global look
if {$value} {
$name.m.edit entryconfigure "Edit mode" -indicatoron true
catch {$name.bbar.edit configure -image icon_mode_edit}
$name.c configure -background $look(canvasbgedit)
} else {
$name.m.edit entryconfigure "Edit mode" -indicatoron false
catch {$name.bbar.edit configure -image icon_mode_run}
$name.c configure -background $look(canvasbgrun)
}
}
--- 1652,1667 ----
# check or uncheck the "edit" menu item
proc pdtk_canvas_editval {name value} {
! global look _
! set self [canvastosym $name.c]
if {$value} {
$name.m.edit entryconfigure "Edit mode" -indicatoron true
catch {$name.bbar.edit configure -image icon_mode_edit}
$name.c configure -background $look(canvasbgedit)
+ set _($self:mode) edit
} else {
$name.m.edit entryconfigure "Edit mode" -indicatoron false
catch {$name.bbar.edit configure -image icon_mode_run}
$name.c configure -background $look(canvasbgrun)
+ set _($self:mode) run
}
}
***************
*** 1612,1621 ****
# create a new text object
proc pdtk_text_new {canvas myname x y text font color} {
- # $canvas create rectangle $x $y $x $y -tags ${myname}_R -fill yellow -width 0
$canvas create text $x $y \
-font [format -*-courier-medium--normal--%d-* $font] \
-tags $myname -text $text -fill $color -anchor nw
! foreach {x1 y1 x2 y2} [$canvas bbox ${myname}] {}
! $canvas coords ${myname}_R $x1 $y1 $x2 $y2
#text $myname -width [string length $text] -height 1 -borderwidth 0 -font {courier -12}
#$myname insert 0.0 $text
--- 1669,1676 ----
# create a new text object
proc pdtk_text_new {canvas myname x y text font color} {
$canvas create text $x $y \
-font [format -*-courier-medium--normal--%d-* $font] \
-tags $myname -text $text -fill $color -anchor nw
! foreach {x1 y1 x2 y2} [$canvas bbox $myname] {}
#text $myname -width [string length $text] -height 1 -borderwidth 0 -font {courier -12}
#$myname insert 0.0 $text
***************
*** 2458,2461 ****
--- 2513,2517 ----
set tooltip(canvas) foo
set tooltip(visible) 0
+ set tooltip(text) ""
# woops, self is for future use
***************
*** 2479,2482 ****
--- 2535,2539 ----
set tooltip(canvas) $canvas
set tooltip(visible) 1
+ set tooltop(text) $text
}
***************
*** 2516,2520 ****
}
#post_to_gui "$r\n"
! show_canvas_tooltip $self $canvas $x $y [string map {" " "\n"} $r]
}
--- 2573,2579 ----
}
#post_to_gui "$r\n"
! set r [string map {" " "\n"} $r]
! global tooltip
! show_canvas_tooltip $self $canvas $x $y $r
}
Index: g_all_guis.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_all_guis.c,v
retrieving revision 1.1.1.4.2.4.2.17
retrieving revision 1.1.1.4.2.4.2.18
diff -C2 -d -r1.1.1.4.2.4.2.17 -r1.1.1.4.2.4.2.18
*** g_all_guis.c 8 Apr 2004 01:59:51 -0000 1.1.1.4.2.4.2.17
--- g_all_guis.c 8 Apr 2004 10:48:11 -0000 1.1.1.4.2.4.2.18
***************
*** 649,659 ****
EXTERN void canvas_savecontainerto(t_canvas *x, t_binbuf *b);
! void pd_upload(t_gobj *self) {
t_binbuf *buf = binbuf_new();
t_class *c = self->g_pd;
int n;
char *s;
! fprintf(stderr,"upload class=%s\n",c->c_name->s_name);
if (strcmp(c->c_name->s_name,"canvas")!=0) {
c->c_savefn(self,buf);
--- 649,660 ----
EXTERN void canvas_savecontainerto(t_canvas *x, t_binbuf *b);
+ EXTERN t_widgetbehavior text_widgetbehavior;
! void pd_upload(t_gobj *self, t_canvas *can) {
t_binbuf *buf = binbuf_new();
t_class *c = self->g_pd;
int n;
char *s;
! /*fprintf(stderr,"upload class=%s\n",c->c_name->s_name);*/
if (strcmp(c->c_name->s_name,"canvas")!=0) {
c->c_savefn(self,buf);
***************
*** 664,673 ****
binbuf_gettext(buf,&s,&n);
if (s[n-1]=='\n') n--;
! sys_vgui("update_object %x {%.*s}\n",(unsigned)self,n,s);
binbuf_free(buf);
free(s);
- }
-
- void pd_upload2(t_gobj *self, t_canvas *can) {
sys_vgui("global _; set _(%x:cx) %d; set _(%x:cy) %d\n",
self, text_xpix((t_object *)self,can), self, text_ypix((t_object *)self,can));
--- 665,674 ----
binbuf_gettext(buf,&s,&n);
if (s[n-1]=='\n') n--;
! sys_vgui("update_object %x {%.*s}\n",
! /*c->c_wb==&text_widgetbehavior ?
! rtext_gettag(glist_findrtext(can,(t_text *)self)) :*/
! (unsigned)self,n,s);
binbuf_free(buf);
free(s);
sys_vgui("global _; set _(%x:cx) %d; set _(%x:cy) %d\n",
self, text_xpix((t_object *)self,can), self, text_ypix((t_object *)self,can));
Index: g_rtext.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_rtext.c,v
retrieving revision 1.1.1.2.2.6.2.7
retrieving revision 1.1.1.2.2.6.2.8
diff -C2 -d -r1.1.1.2.2.6.2.7 -r1.1.1.2.2.6.2.8
*** g_rtext.c 3 Apr 2004 23:10:26 -0000 1.1.1.2.2.6.2.7
--- g_rtext.c 8 Apr 2004 10:48:11 -0000 1.1.1.2.2.6.2.8
***************
*** 53,58 ****
binbuf_gettext(who->te_binbuf, &x->x_buf, &x->x_bufsize);
glist->gl_editor->e_rtext = x;
! sprintf(x->x_tag, ".x%lx.t%lx", (t_int)glist_getcanvas(x->x_glist),
! (t_int)x);
return (x);
}
--- 53,57 ----
binbuf_gettext(who->te_binbuf, &x->x_buf, &x->x_bufsize);
glist->gl_editor->e_rtext = x;
! sprintf(x->x_tag, "%x", x->x_text);
return (x);
}
***************
*** 126,132 ****
*/
- /* LATER get this and sys_vgui to work together properly,
- breaking up messages as needed. As of now, there's
- a limit of 1950 characters, imposed by sys_vgui(). */
#define UPBUFSIZE 4000
#define BOXWIDTH 60
--- 125,128 ----
***************
*** 211,217 ****
canvas, x->x_tag,
dispx + LMARGIN, dispy + TMARGIN,
! outchars, tempbuf, sys_hostfontsize(font), "red"
! /*glist_isselected(x->x_glist,&x->x_glist->gl_gobj) ?
! "$look(objectfgsel)" : "$look(objectfg)")*/);
}
else if (action == SEND_UPDATE)
--- 207,213 ----
canvas, x->x_tag,
dispx + LMARGIN, dispy + TMARGIN,
! outchars, tempbuf, sys_hostfontsize(font),
! glist_isselected(x->x_glist,&x->x_glist->gl_gobj) ?
! "$look(objectfgsel)" : "$look(objectfg)");
}
else if (action == SEND_UPDATE)
Index: u_object.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v
retrieving revision 1.1.2.16
retrieving revision 1.1.2.17
diff -C2 -d -r1.1.2.16 -r1.1.2.17
*** u_object.tk 7 Apr 2004 03:17:40 -0000 1.1.2.16
--- u_object.tk 8 Apr 2004 10:48:12 -0000 1.1.2.17
***************
*** 104,108 ****
} {
$canvas create line $xys -tags $self -width $thick \
! -arrow last -fill $look(wirefg) -smooth yes
}
}
--- 104,109 ----
} {
$canvas create line $xys -tags $self -width $thick \
! -arrow last -fill $look(wirefg)
! # -smooth yes
}
}
***************
*** 127,135 ****
proc io_draw {self canvas x1 y1 xs ys ins outs} {
! global look
set x2 [expr $x1+$xs]
set y2 [expr $y1+$ys]
set fx $look(iopos)
set fy $look(iopos)
set nplus [expr $ins == 1 ? 1 : $ins-1]
for {set i 0} {$i<$ins} {incr i} {
--- 128,138 ----
proc io_draw {self canvas x1 y1 xs ys ins outs} {
! global look _
set x2 [expr $x1+$xs]
set y2 [expr $y1+$ys]
set fx $look(iopos)
set fy $look(iopos)
+ set _($self:inlets) $ins
+ set _($self:outlets) $outs
set nplus [expr $ins == 1 ? 1 : $ins-1]
for {set i 0} {$i<$ins} {incr i} {
***************
*** 161,164 ****
--- 164,180 ----
}
+ proc shadow_draw {self canvas coords} {
+ global look
+ set light [darker ${look(objectbg)}]
+ set dark [darker $light]
+ if {[llength [$canvas gettags ${self}SHAD]] != 0} {
+ $canvas coords ${self}SHAD $coords
+ } {
+ $canvas create rectangle $coords -tag ${self}SHAD \
+ -fill $dark -outline $light -width 2
+ }
+ $canvas move ${self}SHAD 4 4
+ }
+
proc objectbox_draw {self canvas xs ys ins outs} {
global look
***************
*** 170,173 ****
--- 186,190 ----
set xyc [list [expr $x2-1] [expr $y1+1] [expr $x2-1] [expr $y2-1] [expr $x1+1] [expr $y2-1]]
set xyd [list [expr $x1+4] [expr $y1+4] [expr $x2+4] [expr $y2+4]]
+ #shadow_draw $self $canvas $xya
if {[llength [$canvas gettags ${self}BASE]] != 0} {
$canvas coords ${self}BASE $xya
***************
*** 175,179 ****
$canvas coords ${self}BASE3 $xyc
} {
- #$canvas create rectangle $xya -tag ${self}SHAD -fill [darker ${look(objectbg)}] -width 0
$canvas create rectangle $xya -tag ${self}BASE -fill ${look(objectbg)}
$canvas create line $xyb -tag ${self}BASE2 -fill ${look(objectframe1)}
--- 192,195 ----
***************
*** 196,200 ****
proc brokenbox_draw {self canvas xs ys ins outs} {
objectbox_draw $self $canvas $xs $ys $ins $outs
! $canvas itemconfigure ${self}BASE -outline #ff0000
}
--- 212,222 ----
proc brokenbox_draw {self canvas xs ys ins outs} {
objectbox_draw $self $canvas $xs $ys $ins $outs
! $canvas itemconfigure ${self}BASE -outline #ff0000 -width 3
! }
!
! proc brokenbox_select {self canvas flag} {
! global look
! if {$flag} {set colour #ff0000} {set colour $look(objectframe3)}
! $canvas itemconfigure ${self}BASE -outline $colour
}
***************
*** 209,212 ****
--- 231,235 ----
set points [list $x1 $y1 [expr $x2+4] $y1 $x2 [expr $y1+4] $x2 [expr $y2-4] \
[expr $x2+4] $y2 $x1 $y2 $x2 $y2 $x1 $y2]
+ #shadow_draw $self $canvas $points
if {[llength [$canvas gettags ${self}BASE]] != 0} {
$canvas coords ${self}BASE $points
***************
*** 237,240 ****
--- 260,264 ----
set y2 [expr $y1+$ys]
set points [list $x1 $y1 [expr $x2-4] $y1 $x2 [expr $y1+4] $x2 $y2 $x1 $y2]
+ #shadow_draw $self $canvas $points
if {[catch {$canvas canvasx $x1}]} {
post "atom_draw: canvas $canvas does not exist"
***************
*** 264,268 ****
global _
foreach {x1 y1} [object_xy $self $canvas] {}
! set xs [expr 10*$_($self:w)]
set ys $_($self:h)
set x2 [expr $x1+$xs]
--- 288,292 ----
global _
foreach {x1 y1} [object_xy $self $canvas] {}
! set xs [expr 4+10*$_($self:w)]
set ys $_($self:h)
set x2 [expr $x1+$xs]
***************
*** 280,283 ****
--- 304,308 ----
set color "#000000"
#puts "numbox.color = $color"
+ #shadow_draw $self $canvas $points
set points2 [list $x1 $y1 [expr $x1+$half] [expr $y1+$half] $x1 $y2]
if {$isnew} {
***************
*** 305,309 ****
proc numbox_select {self canvas flag} {
global look
- puts "numbox_select $self $canvas $flag"
if {$flag==1} {set colour $look(objectframe4)} {set colour $look(objectframe3)}
$canvas itemconfigure ${self}BASE -outline $colour
--- 330,333 ----
***************
*** 362,366 ****
proc comment_erase {self canvas} {}
! proc bluebox_draw {self canvas x1 y1 xs ys ins outs colour} {
global _
set x2 [expr $x1+$xs]
--- 386,390 ----
proc comment_erase {self canvas} {}
! proc bluebox_draw {self canvas x1 y1 xs ys ins outs} {
global _
set x2 [expr $x1+$xs]
***************
*** 410,415 ****
set ins [expr [string compare $_($self:rcv) empty]==0]
set outs [expr [string compare $_($self:snd) empty]==0]
! set colour [parse_color $_($self:bcol)]
! bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs $colour
if {$orient} {set size $ys} {set size $xs}
set size [expr $size/$n]
--- 434,438 ----
set ins [expr [string compare $_($self:rcv) empty]==0]
set outs [expr [string compare $_($self:snd) empty]==0]
! bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
if {$orient} {set size $ys} {set size $xs}
set size [expr $size/$n]
***************
*** 444,450 ****
}
proc slider_draw {self canvas} {
set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
! global _
foreach {x1 y1} [object_xy $self $canvas] {}
set xs $_($self:w)
--- 467,479 ----
}
+ proc clamp {x min max} {
+ if {$x<$min} {return $min}
+ if {$x>$max} {return $max}
+ return $x
+ }
+
proc slider_draw {self canvas} {
set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
! global _ look
foreach {x1 y1} [object_xy $self $canvas] {}
set xs $_($self:w)
***************
*** 453,463 ****
hsl { set orient 0 }
vsl { set orient 1 }}
! # if {$orient} {set y1 [expr $y1+]} {set x1 [expr $x1-3]}
! # if {$orient} {set ys [expr $ys+5]} {set xs [expr $xs+5]}
set ins [expr [string compare $_($self:rcv) empty]==0]
set outs [expr [string compare $_($self:snd) empty]==0]
switch $_($self:class) {hsl {set orient 0} vsl {set orient 1}}
! set colour [parse_color $_($self:bcol)]
! bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs $colour
if {$isnew} {
set color [bluify #ffffff]
--- 482,491 ----
hsl { set orient 0 }
vsl { set orient 1 }}
! if {$orient} {set y1 [expr $y1-2]} {set x1 [expr $x1-2]}
! if {$orient} {set ys [expr $ys+5]} {set xs [expr $xs+5]}
set ins [expr [string compare $_($self:rcv) empty]==0]
set outs [expr [string compare $_($self:snd) empty]==0]
switch $_($self:class) {hsl {set orient 0} vsl {set orient 1}}
! bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
if {$isnew} {
set color [bluify #ffffff]
***************
*** 466,469 ****
--- 494,514 ----
}
label_draw $self $canvas
+ return
+ #EXPERIMENTAL: (notches)
+ if {$orient} {
+ set thick [clamp [expr $xs/3] 1 5]
+ set x3 [expr $x1+$xs-$thick/2-2]
+ set eighth [expr round($ys/8-1)]
+ .x81f0e88.c create line $x3 $y1 $x3 [expr $y1+$ys] \
+ -dash [list 1 $eighth 1 $eighth] -width $thick \
+ -fill [darker $look(sliderbg)]
+ } else {
+ set thick [clamp [expr $ys/3] 1 5]
+ set y3 [expr $y1+$ys-$thick/2-2]
+ set eighth [expr $xs/8]
+ .x81f0e88.c create line $x1 $y3 [expr $x1+$xs] $y3 \
+ -dash [list 1 $eighth 1 $eighth] -width $thick \
+ -fill [darker $look(sliderbg)]
+ }
}
***************
*** 477,482 ****
if {$orient} {
set size [expr [lindex $pos 2]-$x1]
! set y1 [expr [lindex $pos 3]-($value+50)/100]
! set y2 [expr $y1+2]
$canvas coords ${self}KNOB \
[expr $x1+2] $y1 \
--- 522,527 ----
if {$orient} {
set size [expr [lindex $pos 2]-$x1]
! set y1 [expr [lindex $pos 3]-($value+50)/100-2]
! set y2 [expr $y1-2]
$canvas coords ${self}KNOB \
[expr $x1+2] $y1 \
***************
*** 537,541 ****
set outs [expr [string compare $_($self:snd) empty]==0]
set colour [parse_color $_($self:bcol)]
! bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs $colour
io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
if {$isnew} {
--- 582,586 ----
set outs [expr [string compare $_($self:snd) empty]==0]
set colour [parse_color $_($self:bcol)]
! bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
if {$isnew} {
***************
*** 577,581 ****
set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
set colour [parse_color $_($self:bcol)]
! bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs $colour
io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
set w 1
--- 622,626 ----
set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
set colour [parse_color $_($self:bcol)]
! bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
io_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
set w 1
***************
*** 599,603 ****
proc toggle_set {self canvas v} {
! if {$v} {set fill #000000} {set fill [bluify #ffffff]}
$canvas itemconfigure ${self}X1 -fill $fill
$canvas itemconfigure ${self}X2 -fill $fill
--- 644,653 ----
proc toggle_set {self canvas v} {
! global _
! if {$v} {
! set fill [parse_color $_($self:fcol)]
! } {
! set fill [bluify [parse_color $_($self:bcol)]]
! }
$canvas itemconfigure ${self}X1 -fill $fill
$canvas itemconfigure ${self}X2 -fill $fill
***************
*** 611,615 ****
bluebox_erase $self $canvas
io_erase $self $canvas
! $canvas delete ${self}BUT ${self}LABEL
}
--- 661,665 ----
bluebox_erase $self $canvas
io_erase $self $canvas
! $canvas delete ${self}BUT ${self}LABEL ${self}X1 ${self}X2
}
***************
*** 639,644 ****
set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
set colour [parse_color $_($self:bcol)]
! # bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs $colour
! bluebox_draw $self $canvas [expr $x1-1] [expr $y1-2] [expr $xs+2] [expr $ys+4] $ins $outs "#aaaaaa"
label_draw $self $canvas
--- 689,694 ----
set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
set colour [parse_color $_($self:bcol)]
! # bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs
! bluebox_draw $self $canvas [expr $x1-1] [expr $y1-2] [expr $xs+2] [expr $ys+4] $ins $outs
label_draw $self $canvas
***************
*** 649,653 ****
$canvas delete ${self}RMS
! for {set i 0} {$i<=40} {incr i} {
set y [expr $y1 + ($led_size+1)*(41-$i) - ($led_size+1)/2]
$canvas create rectangle $x3 $y $x4 [expr $y+$led_size] \
--- 699,703 ----
$canvas delete ${self}RMS
! for {set i 1} {$i<=40} {incr i} {
set y [expr $y1 + ($led_size+1)*(41-$i) - ($led_size+1)/2]
$canvas create rectangle $x3 $y $x4 [expr $y+$led_size] \
***************
*** 657,661 ****
if {$isnew} {
$canvas create rectangle $x3 $y1 $x4 $y1 -tags ${self}MASK \
! -width 0 -fill $colour
} {
$canvas coords ${self}MASK $x3 $y1 $x4 $y1
--- 707,711 ----
if {$isnew} {
$canvas create rectangle $x3 $y1 $x4 $y1 -tags ${self}MASK \
! -width 0 -fill [bluify $colour]
} {
$canvas coords ${self}MASK $x3 $y1 $x4 $y1
***************
*** 680,683 ****
--- 730,735 ----
incr i
}
+ #vu_set 0
+ #vu_peak 0
}
***************
*** 703,707 ****
$canvas delete ${self}PEAK
set c [lindex $vu_col $i]
! puts "i=$i c=$c"
set y1 [expr $y1 + ($led_size+1)*(41-$i) - ($led_size+1)/2]
$canvas create rectangle $x1 $y1 [expr $x1+$xs] [expr $y1+$led_size] \
--- 755,759 ----
$canvas delete ${self}PEAK
set c [lindex $vu_col $i]
! #puts "i=$i c=$c"
set y1 [expr $y1 + ($led_size+1)*(41-$i) - ($led_size+1)/2]
$canvas create rectangle $x1 $y1 [expr $x1+$xs] [expr $y1+$led_size] \
***************
*** 715,717 ****
--- 767,770 ----
proc vu_erase {self canvas} {
bluebox_erase $self $canvas
+ $canvas delete ${self}MASK
}
Index: g_vumeter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_vumeter.c,v
retrieving revision 1.1.1.3.2.2.2.8
retrieving revision 1.1.1.3.2.2.2.9
diff -C2 -d -r1.1.1.3.2.2.2.8 -r1.1.1.3.2.2.2.9
*** g_vumeter.c 7 Apr 2004 03:17:40 -0000 1.1.1.3.2.2.2.8
--- g_vumeter.c 8 Apr 2004 10:48:12 -0000 1.1.1.3.2.2.2.9
***************
*** 66,71 ****
sys_mgui((t_iemgui *)x,"vu","erase","");
} else {
! pd_upload((t_gobj *)x);
! pd_upload2((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"vu","draw","");
sys_mgui((t_iemgui *)x,"vu","set","i",x->x_rms);
--- 66,70 ----
sys_mgui((t_iemgui *)x,"vu","erase","");
} else {
! pd_upload((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"vu","draw","");
sys_mgui((t_iemgui *)x,"vu","set","i",x->x_rms);
Index: g_editor.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_editor.c,v
retrieving revision 1.1.1.4.2.3.2.11
retrieving revision 1.1.1.4.2.3.2.12
diff -C2 -d -r1.1.1.4.2.3.2.11 -r1.1.1.4.2.3.2.12
*** g_editor.c 7 Apr 2004 03:17:39 -0000 1.1.1.4.2.3.2.11
--- g_editor.c 8 Apr 2004 10:48:11 -0000 1.1.1.4.2.3.2.12
***************
*** 1021,1025 ****
if (ob && (noutlet = obj_noutlets(ob)) && ypos >= y2-4)
{
! int width = x2-x1;
int nout1 = noutlet>1 ? noutlet-1 : 1;
int closest = ((xpos-x1) * nout1 + width/2)/width;
--- 1021,1025 ----
if (ob && (noutlet = obj_noutlets(ob)) && ypos >= y2-4)
{
! int width = x2-x1;
int nout1 = noutlet>1 ? noutlet-1 : 1;
int closest = ((xpos-x1) * nout1 + width/2)/width;
***************
*** 1033,1042 ****
x->gl_editor->e_xwas = xpos;
x->gl_editor->e_ywas = ypos;
- sys_vgui("wire_draw x .x%x.c %d %d %d %d %d\n",
- x, (issignal ? 2 : 1), xpos, ypos, xpos, ypos);
}
else canvas_setcursor(x, CURSOR_EDITMODE_CONNECT);
}
else if (doit) goto nooutletafterall;
}
/* look for an inlet */
--- 1033,1041 ----
x->gl_editor->e_xwas = xpos;
x->gl_editor->e_ywas = ypos;
}
else canvas_setcursor(x, CURSOR_EDITMODE_CONNECT);
}
else if (doit) goto nooutletafterall;
+
}
/* look for an inlet */
***************
*** 1122,1129 ****
int xwas = x->gl_editor->e_xwas,
ywas = x->gl_editor->e_ywas;
! if (doit) sys_vgui(".x%x.c delete x\n", x);
else sys_vgui("wire_draw x .x%x.c 1 %d %d %d %d\n",
x, x->gl_editor->e_xwas, x->gl_editor->e_ywas, xpos, ypos);
!
y1 = canvas_findhitbox(x, xwas, ywas, &x11, &y11, &x12, &y12);
y2 = canvas_findhitbox(x, xpos, ypos, &x21, &y21, &x22, &y22);
--- 1121,1128 ----
int xwas = x->gl_editor->e_xwas,
ywas = x->gl_editor->e_ywas;
! /* if (doit) sys_vgui(".x%x.c delete x\n", x);
else sys_vgui("wire_draw x .x%x.c 1 %d %d %d %d\n",
x, x->gl_editor->e_xwas, x->gl_editor->e_ywas, xpos, ypos);
! */
y1 = canvas_findhitbox(x, xwas, ywas, &x11, &y11, &x12, &y12);
y2 = canvas_findhitbox(x, xpos, ypos, &x21, &y21, &x22, &y22);
Index: g_hslider.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v
retrieving revision 1.1.1.3.2.2.2.13
retrieving revision 1.1.1.3.2.2.2.14
diff -C2 -d -r1.1.1.3.2.2.2.13 -r1.1.1.3.2.2.2.14
*** g_hslider.c 7 Apr 2004 03:17:40 -0000 1.1.1.3.2.2.2.13
--- g_hslider.c 8 Apr 2004 10:48:11 -0000 1.1.1.3.2.2.2.14
***************
*** 45,50 ****
sys_mgui((t_iemgui *)x,"slider","select","i",x->x_gui.x_fsf.x_selected);
} else {
! pd_upload((t_gobj *)x);
! pd_upload2((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"slider","draw","");
sys_mgui((t_iemgui *)x,"slider","set","i",x->x_val);
--- 45,49 ----
sys_mgui((t_iemgui *)x,"slider","select","i",x->x_gui.x_fsf.x_selected);
} else {
! pd_upload((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"slider","draw","");
sys_mgui((t_iemgui *)x,"slider","set","i",x->x_val);
Index: g_bang.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v
retrieving revision 1.1.1.3.2.2.2.13
retrieving revision 1.1.1.3.2.2.2.14
diff -C2 -d -r1.1.1.3.2.2.2.13 -r1.1.1.3.2.2.2.14
*** g_bang.c 7 Apr 2004 03:17:39 -0000 1.1.1.3.2.2.2.13
--- g_bang.c 8 Apr 2004 10:48:11 -0000 1.1.1.3.2.2.2.14
***************
*** 32,37 ****
sys_mgui((t_iemgui *)x,"bang","select","i",x->x_gui.x_fsf.x_selected);
else {
! pd_upload((t_gobj *)x);
! pd_upload2((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"bang","draw","");}
}
--- 32,36 ----
sys_mgui((t_iemgui *)x,"bang","select","i",x->x_gui.x_fsf.x_selected);
else {
! pd_upload((t_gobj *)x,glist);
sys_mgui((t_iemgui *)x,"bang","draw","");}
}
Index: g_numbox.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v
retrieving revision 1.1.1.4.2.2.2.9
retrieving revision 1.1.1.4.2.2.2.10
diff -C2 -d -r1.1.1.4.2.2.2.9 -r1.1.1.4.2.2.2.10
*** g_numbox.c 7 Apr 2004 03:17:40 -0000 1.1.1.4.2.2.2.9
--- g_numbox.c 8 Apr 2004 10:48:11 -0000 1.1.1.4.2.2.2.10
***************
*** 120,125 ****
(int)x->x_gui.x_fsf.x_selected + 2*(int)x->x_gui.x_fsf.x_change);
else {
! pd_upload((t_gobj *)x);
! pd_upload2((t_gobj *)x,glist);
my_numbox_ftoa(x);
sys_mgui((t_iemgui *)x,"numbox","draw","");
--- 120,124 ----
(int)x->x_gui.x_fsf.x_selected + 2*(int)x->x_gui.x_fsf.x_change);
else {
! pd_upload((t_gobj *)x,glist);
my_numbox_ftoa(x);
sys_mgui((t_iemgui *)x,"numbox","draw","");