diff --git a/src/g_canvas.c b/src/g_canvas.c index 30f47f04..eda8c344 100644 --- a/src/g_canvas.c +++ b/src/g_canvas.c @@ -945,17 +945,16 @@ static void canvas_drawlines(t_canvas *x) char tag[128]; const char *tags[2] = {tag, "cord"}; int issignal; - t_canvas *c = glist_getcanvas(x); linetraverser_start(&t, x); while ((oc = linetraverser_next(&t))) { issignal = (outlet_getsymbol(t.tr_outlet) == &s_signal); sprintf(tag, "l%p", oc); - pdgui_vmess("pdtk_canvas::set_option_types", "ci crr iiii ri rS rr", - c, 1, c, "create", "line", + pdgui_vmess("pdtk_canvas::pdtk_connect", "iiii i Sc r", t.tr_lx1,t.tr_ly1, t.tr_lx2,t.tr_ly2, - "-width", (issignal ? 2 : 1) * x->gl_zoom, - "-tags", 2, tags, "-fill", (issignal ? "signal_cord" : "msg_cord")); + (issignal ? 2 : 1) * x->gl_zoom, + 2, tags, glist_getcanvas(x), + (issignal ? "signal_cord" : "msg_cord")); } } } @@ -972,9 +971,9 @@ void canvas_fixlinesfor(t_canvas *x, t_text *text) { char tag[128]; sprintf(tag, "l%p", oc); - pdgui_vmess(0, "crs iiii", - glist_getcanvas(x), "coords", tag, - t.tr_lx1,t.tr_ly1, t.tr_lx2,t.tr_ly2); + pdgui_vmess("pdtk_canvas::pdtk_coords", "iiii sc", + t.tr_lx1,t.tr_ly1, t.tr_lx2,t.tr_ly2, + tag, glist_getcanvas(x)); } } } diff --git a/src/g_editor.c b/src/g_editor.c index 48d5b8e8..e68d8b16 100644 --- a/src/g_editor.c +++ b/src/g_editor.c @@ -2407,12 +2407,11 @@ static void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, x->gl_editor->e_xwas = xpos; x->gl_editor->e_ywas = ypos; pdgui_vmess("::pdtk_canvas::cords_to_foreground", "ci", x, 0); - pdgui_vmess("pdtk_canvas::set_option_types", - "ci crr iiii ri rs rr", - x, 1, x, "create", "line", + pdgui_vmess("pdtk_canvas::pdtk_connect", + "iiii i rcr", xpos,ypos, xpos,ypos, - "-width", (issignal ? 2 : 1) * x->gl_zoom, - "-tags", "x", "-fill", "selected"); + (issignal ? 2 : 1) * x->gl_zoom, + "x", x, "selected"); } else canvas_setcursor(x, CURSOR_EDITMODE_CONNECT); } @@ -2611,7 +2610,6 @@ static int tryconnect(t_canvas*x, t_object*src, int nout, t_object*sink, int nin int noutlets1, ninlets, lx1, ly1, lx2, ly2; char tag[128]; char*tags[] = {tag, "cord"}; - t_canvas *c = glist_getcanvas(x); sprintf(tag, "l%p", oc); gobj_getrect(&src->ob_g, x, &x11, &y11, &x12, &y12); gobj_getrect(&sink->ob_g, x, &x21, &y21, &x22, &y22); @@ -2627,11 +2625,10 @@ static int tryconnect(t_canvas*x, t_object*src, int nout, t_object*sink, int nin ((x22-x21-iow) * nin)/(ninlets-1) : 0) + iom; ly2 = y21; - pdgui_vmess("pdtk_canvas::set_option_types", "ci crr iiii ri rS", - c, 1, c, "create", "line", + pdgui_vmess("pdtk_canvas::pdtk_connect", "iiii i Sc r", lx1,ly1, lx2,ly2, - "-width", (obj_issignaloutlet(src, nout) ? 2 : 1) * x->gl_zoom, - "-tags", 2, tags, "-fill", + (obj_issignaloutlet(src, nout) ? 2 : 1) * x->gl_zoom, + 2, tags, glist_getcanvas(x), (issignal ? "signal_cord" : "msg_cord")); canvas_undo_add(x, UNDO_CONNECT, "connect", canvas_undo_set_connect(x, canvas_getindex(x, &src->ob_g), nout, @@ -2659,9 +2656,9 @@ static void canvas_doconnect(t_canvas *x, int xpos, int ypos, int mod, int doit) pdgui_vmess(0, "crs", x, "delete", "x"); } else - pdgui_vmess(0, "crs iiii", - x, "coords", "x", - x->gl_editor->e_xwas,x->gl_editor->e_ywas, xpos,ypos); + pdgui_vmess("pdtk_canvas::pdtk_coords", "iiii rc", + x->gl_editor->e_xwas,x->gl_editor->e_ywas, xpos,ypos, + "x", x); if ((y1 = canvas_findhitbox(x, xwas, ywas, &x11, &y11, &x12, &y12)) && (y2 = canvas_findhitbox(x, xpos, ypos, &x21, &y21, &x22, &y22))) @@ -4424,14 +4421,11 @@ void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutno, int issignal = obj_issignaloutlet(objsrc, outno); char tag[128]; char*tags[] = {tag, "cord"}; - t_canvas *c = glist_getcanvas (x); sprintf(tag, "l%p", oc); - pdgui_vmess("pdtk_canvas::set_option_types", - "ci crr iiii ri rS rr", - c, 1, c, "create", "line", - 0, 0, 0, 0, - "-width", (issignal ? 2 : 1) * x->gl_zoom, - "-tags", 2, tags, "-fill", issignal ? "signal_cord" : "msg_cord"); + pdgui_vmess("pdtk_canvas::pdtk_connect", + "iiii i Scr", + 0, 0, 0, 0, (issignal ? 2 : 1) * x->gl_zoom, + 2, tags, glist_getcanvas(x), issignal ? "signal_cord" : "msg_cord"); canvas_fixlinesfor(x, objsrc); } return; diff --git a/src/g_graph.c b/src/g_graph.c index 775bc42b..8183931c 100644 --- a/src/g_graph.c +++ b/src/g_graph.c @@ -661,11 +661,9 @@ void glist_redraw(t_glist *x) { char tagbuf[128]; sprintf(tagbuf, "l%p", oc); - pdgui_vmess("pdtk_canvas::set_option_types", "crs iiii", - glist_getcanvas(x), - "coords", - tagbuf, - t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2); + pdgui_vmess("pdtk_canvas::pdtk_coords", "iiii sc", + t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2, + tagbuf, glist_getcanvas(x)); } canvas_drawredrect(x, 0); if (x->gl_goprect) diff --git a/tcl/pdtk_canvas.tcl b/tcl/pdtk_canvas.tcl index b9a431c9..50917225 100644 --- a/tcl/pdtk_canvas.tcl +++ b/tcl/pdtk_canvas.tcl @@ -520,7 +520,7 @@ proc ::pdtk_canvas::cords_to_foreground {mytoplevel {state 1}} { } } -proc ::pdtk_canvas::pdtk_connect {x1 y1 x2 y2 width tags wind col} { +proc ::pdtk_canvas::pdtk_connect {x1 y1 x2 y2 width tags canv col} { # from pd-l2ork if {$::curve_cords} { set ymax 0; @@ -544,14 +544,14 @@ proc ::pdtk_canvas::pdtk_connect {x1 y1 x2 y2 width tags wind col} { if {$yoff > $ymax} { set yoff $ymax; } - ${wind}.c create line $x1 $y1 $x1 [expr {$y1 + $yoff}] \ + $canv create line $x1 $y1 $x1 [expr {$y1 + $yoff}] \ [expr {$x1 + $halfx}] [expr {$y1 + $halfy}] $x2 \ [expr {$y2 - $yoff}] $x2 $y2 -smooth 1 \ - -width $width -tags $tags -fill [get_color $col $wind] + -width $width -tags $tags -fill [get_color $col $canv] } else { # have to set smooth and splinesteps in case it changes - ${wind}.c create line $x1 $y1 $x2 $y2 -width $width -tags $tags \ - -smooth 1 -splinesteps 36 -fill [get_color $col $wind] + $canv create line $x1 $y1 $x2 $y2 -width $width -tags $tags \ + -smooth 1 -splinesteps 36 -fill [get_color $col $canv] } }