diff --git a/pd/src/g_all_guis.c b/pd/src/g_all_guis.c index fb984b008bec8908a84d2160a54a9e036718b6bc..912b37e8b74b3322863ff2d1b04b6029e8cfbb94 100644 --- a/pd/src/g_all_guis.c +++ b/pd/src/g_all_guis.c @@ -834,3 +834,19 @@ int iem_fstyletoint(t_iem_fstyle_flags *fstylep) { return ((fstylep->x_font_style << 0) & 63); } + +char *iem_get_tag(t_canvas *glist, t_iemgui *iem_obj) +{ + t_gobj *y = (t_gobj *)iem_obj; + t_object *ob = pd_checkobject(&y->g_pd); + + /* GOP objects are unable to call findrtext triggering consistency check error */ + t_rtext *yyyy = NULL; + if (!glist->gl_isgraph || glist_istoplevel(glist)) + yyyy = glist_findrtext(glist_getcanvas(glist), (t_text *)&ob->ob_g); + + /* on GOP we cause segfault as text_gettag() returns bogus data */ + if (yyyy) return(rtext_gettag(yyyy)); + else return("bogus"); +} + diff --git a/pd/src/g_all_guis.h b/pd/src/g_all_guis.h index 5f0fc7f93549e21e82da15356d4d18b6aadda247..83e4aba96520fda038e909f3454ac25650971d50 100644 --- a/pd/src/g_all_guis.h +++ b/pd/src/g_all_guis.h @@ -396,5 +396,6 @@ EXTERN void iem_inttosymargs(t_iem_init_symargs *symargp, int n); EXTERN int iem_symargstoint(t_iem_init_symargs *symargp); EXTERN void iem_inttofstyle(t_iem_fstyle_flags *fstylep, int n); EXTERN int iem_fstyletoint(t_iem_fstyle_flags *fstylep); +EXTERN char *iem_get_tag(t_canvas *glist, t_iemgui *iem_obj); EXTERN void canvas_apply_setundo(t_canvas *x, t_gobj *y); diff --git a/pd/src/g_bang.c b/pd/src/g_bang.c index b24add70beda4543890e47ff4c5c9856890b2c54..9e8a6e3803dff59bc0da08e2822e851da872acda 100644 --- a/pd/src/g_bang.c +++ b/pd/src/g_bang.c @@ -58,47 +58,35 @@ void bng_draw_new(t_bng *x, t_glist *glist) //if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; - - - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxBNG %lx text}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxBNG text %s}\n", canvas, xpos, ypos, xpos + x->x_gui.x_w, ypos + x->x_gui.x_h, - x->x_gui.x_bcol, x, x, x); + x->x_gui.x_bcol, x, x, nlet_tag); t_float cr = (x->x_gui.x_w-2)/2.0; t_float cx = xpos+cr+1.5; t_float cy = ypos+cr+1.5; - sys_vgui(".x%lx.c create circle %f %f -r %f -fill #%6.6x -tags {%lxBUT %lxBNG %lx text}\n", + sys_vgui(".x%lx.c create circle %f %f -r %f -fill #%6.6x -tags {%lxBUT %lxBNG text %s}\n", canvas, cx, cy, cr, - x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, x, x, x); + x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, x, x, nlet_tag); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxBNG %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxBNG text %s}\n", canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, x, x); + x->x_gui.x_lcol, x, x, nlet_tag); if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist) { - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%so%d %so%d %lxBNG %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%so%d %so%d %lxBNG outlet %s}\n", canvas, xpos, ypos + x->x_gui.x_h-1, xpos + IOWIDTH, - ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x); + ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); } if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist) { - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%si%d %si%d %lxBNG %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%si%d %si%d %lxBNG inlet %s}\n", canvas, xpos, ypos, - xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x); + xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); } //} } @@ -111,18 +99,7 @@ void bng_draw_move(t_bng *x, t_glist *glist) if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); sys_vgui(".x%lx.c coords %lxBASE %d %d %d %d\n", canvas, x, xpos, ypos, @@ -213,30 +190,19 @@ void bng_draw_io(t_bng* x, t_glist* glist, int old_snd_rcv_flags) if (glist_isvisible(canvas) && canvas == x->x_gui.x_glist) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%so%d %so%d %lxBNG %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%so%d %so%d %lxBNG outlet %s}\n", canvas, xpos, ypos + x->x_gui.x_h-1, xpos + IOWIDTH, - ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x); + ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able) sys_vgui(".x%lx.c delete %lxBNG%so%d\n", canvas, x, nlet_tag, 0); if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%si%d %si%d %lxBNG %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%si%d %si%d %lxBNG inlet %s}\n", canvas, xpos, ypos, - xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x); + xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) sys_vgui(".x%lx.c delete %lxBNG%si%d\n", canvas, x, nlet_tag, 0); } @@ -256,6 +222,8 @@ void bng_draw_select(t_bng* x, t_glist* glist) // if so, disable highlighting if (x->x_gui.x_glist == glist_getcanvas(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); + sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxBUT -stroke $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); @@ -267,11 +235,11 @@ void bng_draw_select(t_bng* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxBNG %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxBNG %s}\n", canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x, x); + sh->h_pathname, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", @@ -289,11 +257,11 @@ void bng_draw_select(t_bng* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxBNG %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxBNG %s}\n", canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x, x, x); + lh->h_pathname, x, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", lh->h_pathname, lh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index 50d16a9e2a6493fd7d74ae92a931d3ac4d5cba65..fde6149189e12d1885b851cff6c73aa902f316a7 100644 --- a/pd/src/g_canvas.c +++ b/pd/src/g_canvas.c @@ -773,7 +773,7 @@ void canvas_drawredrect(t_canvas *x, int doit) called from the GUI after the fact to "notify" us that we're mapped. */ void canvas_map(t_canvas *x, t_floatarg f) { - //fprintf(stderr,"canvas_map\n"); + //fprintf(stderr,"canvas_map %lx %f\n", (t_int)x, f); int flag = (f != 0); t_gobj *y; if (flag) @@ -823,7 +823,7 @@ void canvas_map(t_canvas *x, t_floatarg f) void canvas_redraw(t_canvas *x) { if (do_not_redraw) return; - //fprintf(stderr,"canvas_redraw\n"); + //fprintf(stderr,"canvas_redraw %lx\n", (t_int)x); if (glist_isvisible(x)) { //fprintf(stderr,"canvas_redraw glist_isvisible=true\n"); diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index 6815eeac9cc076a742384eb2ef772502243633ab..7190a597eec1cfd5bf70b7eba35869dbd1751b6b 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -224,6 +224,7 @@ int gobj_click(t_gobj *x, struct _glist *glist, int canvas_restore_original_position(t_glist *x, t_gobj *y, const char* objtag, int dir) { // we do this instead to save us costly redraw of the canvas + //fprintf(stderr,"canvas_restore_original_position %lx %lx %s %d\n", (t_int)x, (t_int)y, objtag, dir); t_object *ob = NULL; t_rtext *yrnxt = NULL, *yr = NULL; int ret = 0; @@ -244,13 +245,7 @@ int canvas_restore_original_position(t_glist *x, t_gobj *y, const char* objtag, } if (ret != 1) { if (dir == -1) { - if (yrnxt) { - // lower into middle - if (objtag) - sys_vgui("pdtk_find_lowest_widget_withtag_and_arrange .x%lx.c %s %s %s\n", x, rtext_gettag(yrnxt), rtext_gettag(yr), objtag); - else - sys_vgui("pdtk_find_lowest_widget_withtag_and_arrange .x%lx.c %s %s 0\n", x, rtext_gettag(yrnxt), rtext_gettag(yr)); - } else if (x->gl_list == y) { + if (x->gl_list == y) { // we get here if we are supposed to go all the way to the bottom if (objtag) sys_vgui(".x%lx.c addtag arrange withtag %s\n", x, objtag); @@ -261,6 +256,14 @@ int canvas_restore_original_position(t_glist *x, t_gobj *y, const char* objtag, sys_vgui(".x%lx.c dtag %s arrange\n", x, objtag); else sys_vgui(".x%lx.c dtag selected arrange\n", x); + } else if (yrnxt) { + // lower into middle + if (objtag) + sys_vgui("pdtk_find_lowest_widget_withtag_and_arrange .x%lx.c %s %s %s\n", x, rtext_gettag(yrnxt), rtext_gettag(yr), objtag); + else { + sys_vgui(".x%lx.c addtag arrange withtag selected\n", x); + sys_vgui("pdtk_find_lowest_widget_withtag_and_arrange .x%lx.c %s %s 0\n", x, rtext_gettag(yrnxt), rtext_gettag(yr)); + } } else { // fall back to legacy redraw for objects that are not patchable canvas_redraw(x); @@ -271,8 +274,10 @@ int canvas_restore_original_position(t_glist *x, t_gobj *y, const char* objtag, // raise into middle if (objtag) sys_vgui("pdtk_find_lowest_widget_withtag_and_arrange .x%lx.c %s %s %s\n", x, rtext_gettag(yrnxt), rtext_gettag(yr), objtag); - else + else { + sys_vgui(".x%lx.c addtag arrange withtag selected\n", x); sys_vgui("pdtk_find_lowest_widget_withtag_and_arrange .x%lx.c %s %s 0\n", x, rtext_gettag(yrnxt), rtext_gettag(yr)); + } } else if (y->g_next == NULL) { // we get here if we are supposed to go all the way to the top if (objtag) @@ -2191,7 +2196,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) * a gl_editor already, if its not, it will not have a gl_editor. * canvas_create_editor(x) checks if a gl_editor is already created, * so its ok to run it on a canvas that already has a gl_editor. */ - if (x->gl_editor && x->gl_havewindow) + if (x->gl_editor && x->gl_havewindow && glist_isvisible(x)) { /* just put us in front */ //fprintf(stderr,"existing\n"); sys_vgui("raise .x%lx\n", x); @@ -2578,6 +2583,7 @@ static void canvas_doarrange(t_canvas *x, t_float which, t_gobj *oldy, t_gobj *o also added "To Front" and "To Back" */ static void canvas_done_popup(t_canvas *x, t_float which, t_float xpos, t_float ypos) { + //fprintf(stderr,"canvas_done_pupup %lx\n", (t_int)x); char pathbuf[FILENAME_MAX], namebuf[FILENAME_MAX]; t_gobj *y=NULL, *oldy=NULL, *oldy_prev=NULL, *oldy_next=NULL, *y_begin, *y_end=NULL; int x1, y1, x2, y2; @@ -2610,13 +2616,16 @@ static void canvas_done_popup(t_canvas *x, t_float which, t_float xpos, t_float if (!glist_isselected(x, y)) glist_select(x, y); } - // this was a bogus/unsupported call--get me out of here! - if (!x->gl_editor->e_selection) { - post("Popup action could not be performed because multiple items were selected..."); - return; - } } //} + + // this was a bogus/unsupported call for tofront/back--get me out of here! + // we don't have to check for multiple objects being selected since we did noselect + // above explicitly for cases 3 and 4 when detecting more than one selected object + if ((which == 3 || which == 4) && !x->gl_editor->e_selection) { + post("Popup action could not be performed because no object was found under the cursor..."); + return; + } for (y = x->gl_list; y; y = y->g_next) { @@ -2652,11 +2661,12 @@ static void canvas_done_popup(t_canvas *x, t_float which, t_float xpos, t_float //if (!glist_isselected(x, y)) // glist_select(x, y); (*class_getpropertiesfn(pd_class(&y->g_pd)))(y, x); + return; } - return; } else if (which == 1) /* open */ { + //fprintf(stderr,"OPEN\n"); if (!zgetfn(&y->g_pd, gensym("menu-open"))) continue; vmess(&y->g_pd, gensym("menu-open"), ""); @@ -4226,8 +4236,9 @@ static void canvas_displaceselection(t_canvas *x, int dx, int dy) { //fprintf(stderr,"canvas_displaceselection %d %d\n", dx, dy); t_selection *y; + char *tag = NULL; int resortin = 0, resortout = 0; - //old_displace = 0; + old_displace = 0; if (!we_are_undoing && !canvas_undo_already_set_move && x->gl_editor->e_selection) { //canvas_setundo(x, canvas_undo_move, canvas_undo_set_move(x, 1), @@ -4245,11 +4256,17 @@ static void canvas_displaceselection(t_canvas *x, int dx, int dy) //fprintf(stderr, "displaceselection with tag\n"); } else { - /* we will move the non-conforming objects the old way */ + /* we will move the non-conforming objects the old way THIS SHOULD GO AWAY SOON*/ gobj_displace(y->sel_what, x, dx, dy); - canvas_restore_original_position(x, y->sel_what, 0, -1); - //old_displace = 1; - //fprintf(stderr, "displaceselection\n"); + t_object *ob = pd_checkobject(&y->sel_what->g_pd); + t_rtext *yyyy = glist_findrtext(x, (t_text *)&ob->ob_g); + if (yyyy) tag = rtext_gettag(yyyy); + if (tag) + canvas_restore_original_position(x, y->sel_what, tag, -1); + else + old_displace = 1; + tag = NULL; + //fprintf(stderr, "displaceselection old_displace=%d\n", old_displace); } t_class *cl = pd_class(&y->sel_what->g_pd); if (cl == vinlet_class) resortin = 1; @@ -4267,8 +4284,8 @@ static void canvas_displaceselection(t_canvas *x, int dx, int dy) // to proper ordering of objects as they have been redrawn on top // of everything else rather than where they were supposed to be // (e.g. possibly in the middle or at the bottom) - //if (old_displace) canvas_redraw(x); - //old_displace = 0; + if (old_displace) canvas_redraw(x); + old_displace = 0; } /* this routine is called whenever a key is pressed or released. "x" @@ -4712,10 +4729,13 @@ void glob_verifyquit(void *dummy, t_floatarg f) */ void canvas_menuclose(t_canvas *x, t_floatarg fforce) { + //fprintf(stderr,"canvas_menuclose %lx %f\n", (t_int)x, fforce); int force = fforce; t_glist *g; - if (x->gl_owner && (force == 0 || force == 1)) + if (x->gl_owner && (force == 0 || force == 1)) { + fprintf(stderr," invis\n"); canvas_vis(x, 0); /* if subpatch, just invis it */ + } else if (force == 0) { g = glist_finddirty(x); @@ -4726,7 +4746,7 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce) /* if this is an abstraction */ vmess(&g->gl_pd, gensym("menu-open"), ""); } else { - /* is this even necessary? */ + // is this even necessary? canvas_vis(g, 1); } if (!glist_istoplevel(g) && g->gl_env) { @@ -4895,9 +4915,9 @@ static void canvas_find_parent(t_canvas *x) { if (x->gl_owner) { t_glist *owner = x->gl_owner; - while (!glist_isvisible(owner) && owner->gl_owner) + while (!glist_isvisible(owner) && !owner->gl_havewindow && owner->gl_owner) owner = owner->gl_owner; - if (glist_isvisible(owner)) + if (glist_isvisible(owner) && owner->gl_havewindow) canvas_vis(owner, 1); } else { diff --git a/pd/src/g_graph.c b/pd/src/g_graph.c index b4ac53e4a57f76a2cf7ced2b0d85be71baace4f1..d1a07d49544cb63062c7d4f2c392f899f4f75793 100644 --- a/pd/src/g_graph.c +++ b/pd/src/g_graph.c @@ -778,7 +778,7 @@ int garray_getname(t_garray *x, t_symbol **namep); static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) { t_glist *x = (t_glist *)gr; - //fprintf(stderr,"graph vis gobj=.x%lx %d\n", (t_int)gr, vis); + //fprintf(stderr,"graph vis canvas=%lx gobj=%lx %d\n", (t_int)parent_glist, (t_int)gr, vis); //fprintf(stderr,"graph_vis gr=.x%lx parent_glist=.x%lx glist_getcanvas(x->gl_owner)=.x%lx vis=%d\n", (t_int)gr, (t_int)parent_glist, (t_int)glist_getcanvas(x->gl_owner), vis); char tag[50]; t_gobj *g; @@ -817,10 +817,11 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) if (vis && gobj_shouldvis(gr, parent_glist)) { sys_vgui(".x%lx.c create ppolygon\ - %d %d %d %d %d %d %d %d %d %d -tags {%sfill} -fill $graph_outline\n", + %d %d %d %d %d %d %d %d %d %d -tags {%sfill} -fill $graph_outline -stroke $graph_outline\n", glist_getcanvas(x->gl_owner), //parent_glist, x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag); + glist_noselect(x->gl_owner); } else if (gobj_shouldvis(gr, parent_glist)) { @@ -1204,9 +1205,9 @@ static void graph_select(t_gobj *z, t_glist *glist, int state) canvas, rtext_gettag(y), (state? "$select_color" : "$graph_outline")); - sys_vgui(".x%lx.c itemconfigure %sfill -stroke %s\n", + sys_vgui(".x%lx.c itemconfigure %sfill -stroke %s -fill %s\n", canvas, rtext_gettag(y), - (state? "$select_color" : "$graph_outline")); + (state? "$select_color" : "$graph_outline"), (state? "$select_color" : "$graph_outline")); } t_gobj *g; diff --git a/pd/src/g_hdial.c b/pd/src/g_hdial.c index 6d20c884dd784d0fe915bda554e54727e1d180c0..d0232355a54c31edf20a212e040b27cd87c18334 100644 --- a/pd/src/g_hdial.c +++ b/pd/src/g_hdial.c @@ -71,45 +71,34 @@ void hradio_draw_new(t_hradio *x, t_glist *glist) //if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); for(i=0; i<n; i++) { - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE%d %lxHRDO %lx text}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE%d %lxHRDO %s text}\n", canvas, xx11, yy11, xx11+dx, yy12, - x->x_gui.x_bcol, x, i, x, x); - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -stroke #%6.6x -tags {%lxBUT%d %lxHRDO %lx text}\n", + x->x_gui.x_bcol, x, i, x, nlet_tag); + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -stroke #%6.6x -tags {%lxBUT%d %lxHRDO %s text}\n", canvas, xx21, yy21, xx22, yy22, (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, - (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, i, x, x); + (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, i, x, nlet_tag); xx11 += dx; xx21 += dx; xx22 += dx; x->x_drawn = x->x_on; } sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxHRDO %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxHRDO %s text}\n", canvas, xx11b+x->x_gui.x_ldx, yy11+x->x_gui.x_ldy, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, x, x); + x->x_gui.x_lcol, x, x, nlet_tag); if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%so%d %so%d %lxHRDO %lx outlet}\n", - canvas, xx11b, yy12-1, xx11b + IOWIDTH, yy12, x, nlet_tag, 0, nlet_tag, 0, x, x); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%so%d %so%d %lxHRDO %s outlet}\n", + canvas, xx11b, yy12-1, xx11b + IOWIDTH, yy12, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%si%d %si%d %lxHRDO %lx inlet}\n", - canvas, xx11b, yy11, xx11b + IOWIDTH, yy11+1, x, nlet_tag, 0, nlet_tag, 0, x, x); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%si%d %si%d %lxHRDO %s inlet}\n", + canvas, xx11b, yy11, xx11b + IOWIDTH, yy11+1, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); //} } @@ -124,18 +113,7 @@ void hradio_draw_move(t_hradio *x, t_glist *glist) if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); xx11 = xx11b; xx21=xx11b+s4; @@ -235,32 +213,21 @@ void hradio_draw_io(t_hradio* x, t_glist* glist, int old_snd_rcv_flags) if (glist_isvisible(canvas) && canvas == x->x_gui.x_glist) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%so%d %so%d %lxHRDO %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%so%d %so%d %lxHRDO %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_w-1, xpos + IOWIDTH, ypos + x->x_gui.x_w, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able) sys_vgui(".x%lx.c delete %lxHRDO%so%d\n", canvas, x, nlet_tag, 0); if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%si%d %si%d %lxHRDO %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%si%d %si%d %lxHRDO %s inlet}\n", canvas, xpos, ypos, - xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x); + xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) sys_vgui(".x%lx.c delete %lxHRDO%si%d\n", canvas, x, nlet_tag, 0); } @@ -281,6 +248,8 @@ void hradio_draw_select(t_hradio* x, t_glist* glist) // if so, disable highlighting if (x->x_gui.x_glist == glist_getcanvas(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); + for(i=0; i<n; i++) { sys_vgui(".x%lx.c itemconfigure %lxBASE%d -stroke $select_color\n", canvas, x, i); @@ -294,11 +263,11 @@ void hradio_draw_select(t_hradio* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxHRDO %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxHRDO %s}\n", canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w * x->x_number - SCALEHANDLE_WIDTH - 1, x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x, x); + sh->h_pathname, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", @@ -315,11 +284,11 @@ void hradio_draw_select(t_hradio* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxHRDO %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxHRDO %s}\n", canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x, x, x); + lh->h_pathname, x, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", lh->h_pathname, lh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", diff --git a/pd/src/g_hslider.c b/pd/src/g_hslider.c index ab79164ec4867dd0834f3398dc076a4739cebe5e..594c4da6a76f4e50de9f49487673ab9724bc2207 100644 --- a/pd/src/g_hslider.c +++ b/pd/src/g_hslider.c @@ -83,41 +83,30 @@ static void hslider_draw_new(t_hslider *x, t_glist *glist) //if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; - - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxHSLDR %lx text}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxHSLDR %s text}\n", canvas, xpos, ypos, xpos + x->x_gui.x_w+5, ypos + x->x_gui.x_h, - x->x_gui.x_bcol, x, x, x); - sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth 3 -stroke #%6.6x -tags {%lxKNOB %lxHSLDR %lx text}\n", + x->x_gui.x_bcol, x, x, nlet_tag); + sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth 3 -stroke #%6.6x -tags {%lxKNOB %lxHSLDR %s text}\n", canvas, r, ypos+2, r, - ypos + x->x_gui.x_h-2, x->x_gui.x_fcol, x, x, x); + ypos + x->x_gui.x_h-2, x->x_gui.x_fcol, x, x, nlet_tag); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxHSLDR %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxHSLDR % text}\n", canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, x, x); + x->x_gui.x_lcol, x, x, nlet_tag); if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%so%d %so%d %lxHSLDR %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%so%d %so%d %lxHSLDR %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_h-1, - xpos+7, ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x); + xpos+7, ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%si%d %si%d %lxHSLDR %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%si%d %si%d %lxHSLDR %s inlet}\n", canvas, xpos, ypos, - xpos+7, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x); + xpos+7, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); //} } @@ -130,18 +119,7 @@ static void hslider_draw_move(t_hslider *x, t_glist *glist) if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); sys_vgui(".x%lx.c coords %lxBASE %d %d %d %d\n", canvas, x, @@ -198,14 +176,6 @@ static void hslider_draw_config(t_hslider* x,t_glist* glist) { t_canvas *canvas=glist_getcanvas(glist); - /* - char color[64]; - if (x->x_gui.x_fsf.x_selected) - sprintf(color, "$select_color"); - else - sprintf(color, "#%6.6x", x->x_gui.x_lcol); - */ - if (x->x_gui.x_fsf.x_selected && x->x_gui.x_glist == canvas) sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} -%d %s} -fill $select_color -text {%s} \n", canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, @@ -217,7 +187,6 @@ static void hslider_draw_config(t_hslider* x,t_glist* glist) strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:""); sys_vgui(".x%lx.c itemconfigure %lxKNOB -stroke #%6.6x\n .x%lx.c itemconfigure %lxBASE -fill #%6.6x\n", canvas, x, x->x_gui.x_fcol, canvas, x, x->x_gui.x_bcol); - //sys_vgui(".x%lx.c itemconfigure %lxBASE -fill #%6.6x\n", canvas, x, x->x_gui.x_bcol); } static void hslider_draw_io(t_hslider* x,t_glist* glist, int old_snd_rcv_flags) @@ -228,29 +197,18 @@ static void hslider_draw_io(t_hslider* x,t_glist* glist, int old_snd_rcv_flags) if (glist_isvisible(canvas) && canvas == x->x_gui.x_glist) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%so%d %so%d %lxHSLDR %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%so%d %so%d %lxHSLDR %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_h-1, - xpos+7, ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x); + xpos+7, ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able) sys_vgui(".x%lx.c delete %lxHSLDR%so%d\n", canvas, x, nlet_tag, 0); if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%si%d %si%d %lxHSLDR %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%si%d %si%d %lxHSLDR %s inlet}\n", canvas, xpos, ypos, - xpos+7, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x); + xpos+7, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) sys_vgui(".x%lx.c delete %lxHSLDR%si%d\n", canvas, x, nlet_tag, 0); } @@ -270,6 +228,8 @@ static void hslider_draw_select(t_hslider* x,t_glist* glist) // if so, disable highlighting if (x->x_gui.x_glist == glist_getcanvas(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); + sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); @@ -280,11 +240,11 @@ static void hslider_draw_select(t_hslider* x,t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxHSLDR %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxHSLDR %s}\n", canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w + 5 - SCALEHANDLE_WIDTH - 1, x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x, x); + sh->h_pathname, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", @@ -302,11 +262,11 @@ static void hslider_draw_select(t_hslider* x,t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxHSLDR %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxHSLDR %s}\n", canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x, x, x); + lh->h_pathname, x, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", lh->h_pathname, lh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", diff --git a/pd/src/g_mycanvas.c b/pd/src/g_mycanvas.c index 089b57562ebbece81a16580fb14732a1747d72cb..0a1a388d505e4935830af1b2407498f1a4a8aa48 100644 --- a/pd/src/g_mycanvas.c +++ b/pd/src/g_mycanvas.c @@ -48,21 +48,22 @@ void my_canvas_draw_new(t_my_canvas *x, t_glist *glist) sprintf(lh->h_pathname, ".x%lx.h%lx", (t_int)canvas, (t_int)lh); //if (glist_isvisible(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -stroke #%6.6x -tags {%lxRECT %lxMYCNV %lx text}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -stroke #%6.6x -tags {%lxRECT %lxMYCNV %s text}\n", canvas, xpos, ypos, xpos + x->x_vis_w, ypos + x->x_vis_h, - x->x_gui.x_bcol, x->x_gui.x_bcol, x, x, x); - sys_vgui(".x%lx.c create prect %d %d %d %d -stroke #%6.6x -tags {%lxBASE %lxMYCNV %lx text}\n", + x->x_gui.x_bcol, x->x_gui.x_bcol, x, x, nlet_tag); + sys_vgui(".x%lx.c create prect %d %d %d %d -stroke #%6.6x -tags {%lxBASE %lxMYCNV %s text}\n", canvas, xpos, ypos, xpos + x->x_gui.x_w, ypos + x->x_gui.x_h, - x->x_gui.x_bcol, x, x, x); + x->x_gui.x_bcol, x, x, nlet_tag); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxMYCNV %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxMYCNV %s text}\n", canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, x, x); + x->x_gui.x_lcol, x, x, nlet_tag); //} } @@ -148,6 +149,8 @@ void my_canvas_draw_select(t_my_canvas* x, t_glist* glist) // if so, disable highlighting if (x->x_gui.x_glist == glist_getcanvas(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); + sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke $select_color\n", canvas, x); if (x->x_gui.scale_vis) { @@ -157,11 +160,11 @@ void my_canvas_draw_select(t_my_canvas* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxMYCNV %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxMYCNV %s}\n", canvas, x->x_gui.x_obj.te_xpix + x->x_vis_w - SCALEHANDLE_WIDTH - 1, x->x_gui.x_obj.te_ypix + x->x_vis_h - SCALEHANDLE_HEIGHT - 1, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x, x); + sh->h_pathname, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", @@ -179,11 +182,11 @@ void my_canvas_draw_select(t_my_canvas* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxMYCNV %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxMYCNV %s}\n", canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x, x, x); + lh->h_pathname, x, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", lh->h_pathname, lh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", diff --git a/pd/src/g_numbox.c b/pd/src/g_numbox.c index ad488065e6b685b60c7d7fa06bff19470466f33d..8972b6452ddb8431844538d2676728260ba5a2cf 100644 --- a/pd/src/g_numbox.c +++ b/pd/src/g_numbox.c @@ -200,71 +200,60 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist) //if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if (x->x_hide_frame <= 1) { sys_vgui( ".x%lx.c create ppolygon %d %d %d %d %d %d %d %d %d %d -stroke #%6.6x \ - -fill #%6.6x -tags {%lxBASE1 %lxNUM %lx text}\n", + -fill #%6.6x -tags {%lxBASE1 %lxNUM %s text}\n", canvas, xpos, ypos, xpos + x->x_numwidth-4, ypos, xpos + x->x_numwidth, ypos+4, xpos + x->x_numwidth, ypos + x->x_gui.x_h, xpos, ypos + x->x_gui.x_h, - IEM_GUI_COLOR_NORMAL, x->x_gui.x_bcol, x, x, x); + IEM_GUI_COLOR_NORMAL, x->x_gui.x_bcol, x, x, nlet_tag); if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxNUM%so%d %so%d %lxNUM %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxNUM%so%d %so%d %lxNUM %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_h-1, xpos+IOWIDTH, ypos + x->x_gui.x_h, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxNUM%si%d %si%d %lxNUM %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxNUM%si%d %si%d %lxNUM %s inlet}\n", canvas, xpos, ypos, xpos+IOWIDTH, ypos+1, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); } else { sys_vgui( ".x%lx.c create ppolygon %d %d %d %d %d %d %d %d %d %d -stroke #%6.6x \ - -fill #%6.6x -tags {%lxBASE1 %lxNUM %lx text}\n", + -fill #%6.6x -tags {%lxBASE1 %lxNUM %s text}\n", canvas, xpos, ypos, xpos + x->x_numwidth-4, ypos, xpos + x->x_numwidth, ypos+4, xpos + x->x_numwidth, ypos + x->x_gui.x_h, xpos, ypos + x->x_gui.x_h, - x->x_gui.x_bcol, x->x_gui.x_bcol, x, x, x); + x->x_gui.x_bcol, x->x_gui.x_bcol, x, x, nlet_tag); } if (!x->x_hide_frame || x->x_hide_frame == 2) sys_vgui( - ".x%lx.c create polyline %d %d %d %d %d %d -stroke #%6.6x -tags {%lxBASE2 %lxNUM %lx text}\n", + ".x%lx.c create polyline %d %d %d %d %d %d -stroke #%6.6x -tags {%lxBASE2 %lxNUM %s text}\n", canvas, xpos, ypos, xpos + half, ypos + half, xpos, ypos + x->x_gui.x_h, - x->x_gui.x_fcol, x, x, x); + x->x_gui.x_fcol, x, x, nlet_tag); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxNUM %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxNUM %s text}\n", canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, x, x); + x->x_gui.x_lcol, x, x, nlet_tag); my_numbox_ftoa(x); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxNUMBER %lxNUM %lx noscroll text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxNUMBER %lxNUM %s noscroll text}\n", canvas, xpos+half+2, ypos+half+d, x->x_buf, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_fcol, x, x, x); + x->x_gui.x_fcol, x, x, nlet_tag); //} } @@ -277,18 +266,7 @@ static void my_numbox_draw_move(t_my_numbox *x, t_glist *glist) if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); sys_vgui(".x%lx.c coords %lxBASE1 %d %d %d %d %d %d %d %d %d %d\n", canvas, x, xpos, ypos, @@ -337,16 +315,6 @@ static void my_numbox_draw_erase(t_my_numbox* x,t_glist* glist) sys_vgui("destroy %s\n", lh->h_pathname); sys_vgui(".x%lx.c delete %lxLABELH\n", canvas, x); } -/* - sys_vgui(".x%lx.c delete %lxBASE1\n", canvas, x); - sys_vgui(".x%lx.c delete %lxBASE2\n", canvas, x); - sys_vgui(".x%lx.c delete %lxLABEL\n", canvas, x); - sys_vgui(".x%lx.c delete %lxNUMBER\n", canvas, x); - if(!x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c delete %lxOUT%d\n", canvas, x, 0); - if(!x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c delete %lxIN%d\n", canvas, x, 0); -*/ } static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist) @@ -403,33 +371,22 @@ static void my_numbox_draw_io(t_my_numbox* x,t_glist* glist, int old_snd_rcv_fla if (glist_isvisible(canvas) && canvas == x->x_gui.x_glist) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxNUM%so%d %so%d %lxNUM %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxNUM%so%d %so%d %lxNUM %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_h-1, xpos+IOWIDTH, ypos + x->x_gui.x_h, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able) sys_vgui(".x%lx.c delete %lxNUM%so%d\n", canvas, x, nlet_tag, 0); if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxNUM%si%d %si%d %lxNUM %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxNUM%si%d %si%d %lxNUM %s inlet}\n", canvas, xpos, ypos, xpos+IOWIDTH, ypos+1, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) sys_vgui(".x%lx.c delete %lxNUM%si%d\n", canvas, x, nlet_tag, 0); @@ -458,6 +415,8 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) // if so, disable highlighting if (x->x_gui.x_glist == glist_getcanvas(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); + sys_vgui(".x%lx.c itemconfigure %lxBASE1 -stroke $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxBASE2 -stroke $select_color\n", @@ -474,11 +433,11 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxNUM %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxNUM %s}\n", canvas, x->x_gui.x_obj.te_xpix + x->x_numwidth - SCALEHANDLE_WIDTH - 1, x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x, x); + sh->h_pathname, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", @@ -495,11 +454,11 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxNUM %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxNUM %s}\n", canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x, x, x); + lh->h_pathname, x, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", lh->h_pathname, lh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", diff --git a/pd/src/g_toggle.c b/pd/src/g_toggle.c index ce54bb47993ef1f74ce1d602f83243b05a32b7de..b063836926ce48633c0422b4112a3f089002a047 100644 --- a/pd/src/g_toggle.c +++ b/pd/src/g_toggle.c @@ -62,45 +62,34 @@ void toggle_draw_new(t_toggle *x, t_glist *glist) //if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if(x->x_gui.x_w >= 30) w = 2; if(x->x_gui.x_w >= 60) w = 3; - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxTGL %lx text}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxTGL %s text}\n", canvas, xx, yy, xx + x->x_gui.x_w, yy + x->x_gui.x_h, - x->x_gui.x_bcol, x, x, x); - sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %d -stroke #%6.6x -tags {%lxX1 %lxTGL %lx text}\n", + x->x_gui.x_bcol, x, x, nlet_tag); + sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %d -stroke #%6.6x -tags {%lxX1 %lxTGL %s text}\n", canvas, xx+w+1, yy+w+1, xx + x->x_gui.x_w-w-1, yy + x->x_gui.x_h-w-1, w, - (x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, x, x); - sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %d -stroke #%6.6x -tags {%lxX2 %lxTGL %lx text}\n", + (x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, x, nlet_tag); + sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %d -stroke #%6.6x -tags {%lxX2 %lxTGL %s text}\n", canvas, xx+w+1, yy + x->x_gui.x_h-w-1, xx + x->x_gui.x_w-w-1, yy+w+1, w, - (x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, x, x); + (x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, x, nlet_tag); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxTGL %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxTGL %s text}\n", canvas, xx+x->x_gui.x_ldx, yy+x->x_gui.x_ldy, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, x, x); + x->x_gui.x_lcol, x, x, nlet_tag); if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxTGL%so%d %so%d %lxTGL %lx outlet}\n", - canvas, xx, yy + x->x_gui.x_h-1, xx + IOWIDTH, yy + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxTGL%so%d %so%d %lxTGL %s outlet}\n", + canvas, xx, yy + x->x_gui.x_h-1, xx + IOWIDTH, yy + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxTGL%si%d %si%d %lxTGL %lx inlet}\n", - canvas, xx, yy, xx + IOWIDTH, yy+1, x, nlet_tag, 0, nlet_tag, 0, x, x); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxTGL%si%d %si%d %lxTGL %s inlet}\n", + canvas, xx, yy, xx + IOWIDTH, yy+1, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); //} } @@ -111,18 +100,7 @@ void toggle_draw_move(t_toggle *x, t_glist *glist) if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if(x->x_gui.x_w >= 30) w = 2; @@ -165,16 +143,6 @@ void toggle_draw_erase(t_toggle* x, t_glist* glist) sys_vgui("destroy %s\n", lh->h_pathname); sys_vgui(".x%lx.c delete %lxLABELH\n", canvas, x); } -/* - sys_vgui(".x%lx.c delete %lxBASE\n", canvas, x); - sys_vgui(".x%lx.c delete %lxX1\n", canvas, x); - sys_vgui(".x%lx.c delete %lxX2\n", canvas, x); - sys_vgui(".x%lx.c delete %lxLABEL\n", canvas, x); - if(!x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c delete %lxOUT%d\n", canvas, x, 0); - if(!x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c delete %lxIN%d\n", canvas, x, 0); -*/ } void toggle_draw_config(t_toggle* x, t_glist* glist) @@ -225,30 +193,19 @@ void toggle_draw_io(t_toggle* x, t_glist* glist, int old_snd_rcv_flags) if (glist_isvisible(canvas) && canvas == x->x_gui.x_glist) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxTGL%so%d %so%d %lxTGL %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxTGL%so%d %so%d %lxTGL %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_h-1, xpos + IOWIDTH, - ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x); + ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able) sys_vgui(".x%lx.c delete %lxTGL%so%d\n", canvas, x, nlet_tag, 0); if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxTGL%si%d %si%d %lxTGL %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxTGL%si%d %si%d %lxTGL %s outlet}\n", canvas, xpos, ypos, - xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x); + xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) sys_vgui(".x%lx.c delete %lxTGL%si%d\n", canvas, x, nlet_tag, 0); } @@ -269,6 +226,8 @@ void toggle_draw_select(t_toggle* x, t_glist* glist) // if so, disable highlighting if (x->x_gui.x_glist == glist_getcanvas(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); + sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); @@ -279,11 +238,11 @@ void toggle_draw_select(t_toggle* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxTGL %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxTGL %s}\n", canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x, x); + sh->h_pathname, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", @@ -301,11 +260,11 @@ void toggle_draw_select(t_toggle* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxTGL %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxTGL %s}\n", canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x, x, x); + lh->h_pathname, x, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", lh->h_pathname, lh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", diff --git a/pd/src/g_vdial.c b/pd/src/g_vdial.c index d6e1b5a17cacec6573c23d01631fb11bac51ef8a..08d347057c5b351332984a30c41564c00e42180c 100644 --- a/pd/src/g_vdial.c +++ b/pd/src/g_vdial.c @@ -69,28 +69,17 @@ void vradio_draw_new(t_vradio *x, t_glist *glist) //if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); for(i=0; i<n; i++) { - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE%d %lxVRDO %lx text}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE%d %lxVRDO %s text}\n", canvas, xx11, yy11, xx12, yy12, - x->x_gui.x_bcol, x, i, x, x); - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -stroke #%6.6x -tags {%lxBUT%d %lxVRDO %lx text}\n", + x->x_gui.x_bcol, x, i, x, nlet_tag); + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -stroke #%6.6x -tags {%lxBUT%d %lxVRDO %s text}\n", canvas, xx21, yy21, xx22, yy22, (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, - (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, i, x, x); + (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, i, x, nlet_tag); yy11 += dy; yy12 += dy; yy21 += dy; @@ -98,17 +87,17 @@ void vradio_draw_new(t_vradio *x, t_glist *glist) x->x_drawn = x->x_on; } sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxVRDO %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxVRDO %s text}\n", canvas, xx11+x->x_gui.x_ldx, yy11b+x->x_gui.x_ldy, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, x, x); + x->x_gui.x_lcol, x, x, nlet_tag); if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVRDO%so%d %so%d %lxVRDO %lx outlet}\n", - canvas, xx11, yy11-1, xx11 + IOWIDTH, yy11, x, nlet_tag, 0, nlet_tag, 0, x, x); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVRDO%so%d %so%d %lxVRDO %s outlet}\n", + canvas, xx11, yy11-1, xx11 + IOWIDTH, yy11, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVRDO%si%d %si%d %lxVRDO %lx inlet}\n", - canvas, xx11, yy11b, xx11 + IOWIDTH, yy11b+1, x, nlet_tag, 0, nlet_tag, 0, x, x); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVRDO%si%d %si%d %lxVRDO %s inlet}\n", + canvas, xx11, yy11b, xx11 + IOWIDTH, yy11b+1, x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); //} } @@ -124,18 +113,7 @@ void vradio_draw_move(t_vradio *x, t_glist *glist) if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); for(i=0; i<n; i++) { @@ -177,19 +155,6 @@ void vradio_draw_erase(t_vradio* x, t_glist* glist) sys_vgui("destroy %s\n", lh->h_pathname); sys_vgui(".x%lx.c delete %lxLABELH\n", canvas, x); } - -/* - for(i=0; i<n; i++) - { - sys_vgui(".x%lx.c delete %lxBASE%d\n", canvas, x, i); - sys_vgui(".x%lx.c delete %lxBUT%d\n", canvas, x, i); - } - sys_vgui(".x%lx.c delete %lxLABEL\n", canvas, x); - if(!x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c delete %lxOUT%d\n", canvas, x, 0); - if(!x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c delete %lxIN%d\n", canvas, x, 0); -*/ } void vradio_draw_config(t_vradio* x, t_glist* glist) @@ -234,32 +199,21 @@ void vradio_draw_io(t_vradio* x, t_glist* glist, int old_snd_rcv_flags) if (glist_isvisible(canvas) && canvas == x->x_gui.x_glist) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVRDO%so%d %so%d %lxVRDO %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVRDO%so%d %so%d %lxVRDO %s outlet}\n", canvas, xpos, ypos+(x->x_number*x->x_gui.x_h)-1, xpos+ IOWIDTH, - ypos+(x->x_number*x->x_gui.x_h), x, nlet_tag, 0, nlet_tag, 0, x, x); + ypos+(x->x_number*x->x_gui.x_h), x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able) sys_vgui(".x%lx.c delete %lxVRDO%so%d\n", canvas, x, nlet_tag, 0); if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVRDO%si%d %si%d %lxVRDO %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVRDO%si%d %si%d %lxVRDO %s inlet}\n", canvas, xpos, ypos, xpos+ IOWIDTH, ypos+1, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) sys_vgui(".x%lx.c delete %lxVRDO%si%d\n", canvas, x, nlet_tag, 0); } @@ -281,6 +235,8 @@ void vradio_draw_select(t_vradio* x, t_glist* glist) // if so, disable highlighting if (x->x_gui.x_glist == glist_getcanvas(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); + for(i=0; i<n; i++) { sys_vgui(".x%lx.c itemconfigure %lxBASE%d -stroke $select_color\n", canvas, x, i); @@ -294,11 +250,11 @@ void vradio_draw_select(t_vradio* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVRDO %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVRDO %s}\n", canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, x->x_gui.x_obj.te_ypix + x->x_gui.x_h * x->x_number - SCALEHANDLE_HEIGHT - 1, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x, x); + sh->h_pathname, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", @@ -316,11 +272,11 @@ void vradio_draw_select(t_vradio* x, t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH lxVDRO %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH lxVDRO %s}\n", canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x, x, x); + lh->h_pathname, x, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", lh->h_pathname, lh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", diff --git a/pd/src/g_vslider.c b/pd/src/g_vslider.c index b1df04342f591f2ac25d0f953e25019b96ea335a..9821bd81515c0a960468f9bcb413384d09d22ca8 100644 --- a/pd/src/g_vslider.c +++ b/pd/src/g_vslider.c @@ -83,44 +83,33 @@ static void vslider_draw_new(t_vslider *x, t_glist *glist) //if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; - - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxVSLDR %lx text}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxVSLDR %s text}\n", canvas, xpos, ypos, xpos + x->x_gui.x_w, ypos + x->x_gui.x_h+5, - x->x_gui.x_bcol, x, x, x); - sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth 3 -stroke #%6.6x -tags {%lxKNOB %lxVSLDR %lx text}\n", + x->x_gui.x_bcol, x, x, nlet_tag); + sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth 3 -stroke #%6.6x -tags {%lxKNOB %lxVSLDR %s text}\n", canvas, xpos+2, r, - xpos + x->x_gui.x_w-2, r, x->x_gui.x_fcol, x, x, x); + xpos + x->x_gui.x_w-2, r, x->x_gui.x_fcol, x, x, nlet_tag); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxVSLDR %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxVSLDR %s text}\n", canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, x, x); + x->x_gui.x_lcol, x, x, nlet_tag); if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVSLDR%so%d %so%d %lxVSLDR %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVSLDR%so%d %so%d %lxVSLDR %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_h+4, xpos+7, ypos + x->x_gui.x_h+5, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVSLDR%si%d %si%d %lxVSLDR %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVSLDR%si%d %si%d %lxVSLDR %s inlet}\n", canvas, xpos, ypos, xpos+7, ypos+1, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); //} } @@ -133,18 +122,7 @@ static void vslider_draw_move(t_vslider *x, t_glist *glist) if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); sys_vgui(".x%lx.c coords %lxBASE %d %d %d %d\n", canvas, x, @@ -186,15 +164,6 @@ static void vslider_draw_erase(t_vslider* x,t_glist* glist) sys_vgui("destroy %s\n", lh->h_pathname); sys_vgui(".x%lx.c delete %lxLABELH\n", canvas, x); } -/* - sys_vgui(".x%lx.c delete %lxBASE\n", canvas, x); - sys_vgui(".x%lx.c delete %lxKNOB\n", canvas, x); - sys_vgui(".x%lx.c delete %lxLABEL\n", canvas, x); - if(!x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c delete %lxOUT%d\n", canvas, x, 0); - if(!x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c delete %lxIN%d\n", canvas, x, 0); -*/ } static void vslider_draw_config(t_vslider* x,t_glist* glist) @@ -232,33 +201,22 @@ static void vslider_draw_io(t_vslider* x,t_glist* glist, int old_snd_rcv_flags) if (glist_isvisible(canvas) && canvas == x->x_gui.x_glist) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVSLDR%so%d %so%d %lxVSLDR %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVSLDR%so%d %so%d %lxVSLDR %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_h+4, xpos+7, ypos + x->x_gui.x_h+5, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able) sys_vgui(".x%lx.c delete %lxVSLDR%so%d\n", canvas, x, nlet_tag, 0); if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able) - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVSLDR%si%d %si%d %lxVSLDR %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVSLDR%si%d %si%d %lxVSLDR %s inlet}\n", canvas, xpos, ypos, xpos+7, ypos+1, - x, nlet_tag, 0, nlet_tag, 0, x, x); + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) sys_vgui(".x%lx.c delete %lxVSLDR%si%d\n", canvas, x, nlet_tag, 0); } @@ -278,6 +236,8 @@ static void vslider_draw_select(t_vslider *x, t_glist *glist) // if so, disable highlighting if (x->x_gui.x_glist == glist_getcanvas(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); + sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); @@ -288,11 +248,11 @@ static void vslider_draw_select(t_vslider *x, t_glist *glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVSLDR %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVSLDR %s}\n", canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, x->x_gui.x_obj.te_ypix + 5 + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x, x); + sh->h_pathname, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", @@ -310,11 +270,11 @@ static void vslider_draw_select(t_vslider *x, t_glist *glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxVSLDR %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxVSLDR %s}\n", canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x, x, x); + lh->h_pathname, x, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", lh->h_pathname, lh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", diff --git a/pd/src/g_vumeter.c b/pd/src/g_vumeter.c index d8e898651f686954c0e13b9768bcfced479c3ecc..c3c5ab9c93df7e8b9bec488671f7da3df607b1a2 100644 --- a/pd/src/g_vumeter.c +++ b/pd/src/g_vumeter.c @@ -118,83 +118,72 @@ static void vu_draw_new(t_vu *x, t_glist *glist) //if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; - - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxVU %lx text}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxVU %s text}\n", canvas, xpos, ypos, xpos+x->x_gui.x_w+2, - ypos+x->x_gui.x_h+4, x->x_gui.x_bcol, x, x, x); + ypos+x->x_gui.x_h+4, x->x_gui.x_bcol, x, x, nlet_tag); for(i=1; i<=IEM_VU_STEPS; i++) { led_col = iemgui_vu_col[i]; yyy = k4 + k1*(k2-i); - sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %d -stroke #%6.6x -tags {%lxRLED%d %lxVU %lx text}\n", - canvas, quad1+1, yyy+2, quad3, yyy+2, x->x_led_size, iemgui_color_hex[led_col], x, i, x, x); + sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %d -stroke #%6.6x -tags {%lxRLED%d %lxVU %s text}\n", + canvas, quad1+1, yyy+2, quad3, yyy+2, x->x_led_size, iemgui_color_hex[led_col], x, i, x, nlet_tag); if(((i+2)&3) && (x->x_scale)) sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxSCALE%d %lxVU %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxSCALE%d %lxVU %s text}\n", canvas, end+1, yyy+k3+2, iemgui_vu_scale_str[i], x->x_gui.x_font, x->x_gui.x_fontsize, - sys_fontweight, x->x_gui.x_lcol, x, i, x, x); + sys_fontweight, x->x_gui.x_lcol, x, i, x, nlet_tag); } if(x->x_scale) { i=IEM_VU_STEPS+1; yyy = k4 + k1*(k2-i); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxSCALE%d %lxVU %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxSCALE%d %lxVU %s text}\n", canvas, end+1, yyy+k3+2, iemgui_vu_scale_str[i], x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, i, x, x); + x->x_gui.x_lcol, x, i, x, nlet_tag); } - sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -stroke #%6.6x -tags {%lxRCOVER %lxVU %lx text}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -stroke #%6.6x -tags {%lxRCOVER %lxVU %s text}\n", canvas, quad1+1, ypos+1, quad3, - ypos+1 + k1*IEM_VU_STEPS, x->x_gui.x_bcol, x->x_gui.x_bcol, x, x, x); - sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %d -fill #%6.6x -tags {%lxPLED %lxVU %lx text}\n", + ypos+1 + k1*IEM_VU_STEPS, x->x_gui.x_bcol, x->x_gui.x_bcol, x, x, nlet_tag); + sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %d -fill #%6.6x -tags {%lxPLED %lxVU %s text}\n", canvas, mid+1, ypos+12, - mid+1, ypos+12, x->x_led_size, x->x_gui.x_bcol, x, x, x); + mid+1, ypos+12, x->x_led_size, x->x_gui.x_bcol, x, x, nlet_tag); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxVU %lx text}\n", + -font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxVU %s text}\n", canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, - x->x_gui.x_lcol, x, x, x); + x->x_gui.x_lcol, x, x, nlet_tag); if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist) { - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%so%d %so%d %lxVU %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%so%d %so%d %lxVU %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_h+3, xpos + IOWIDTH, ypos + x->x_gui.x_h+4, - x, nlet_tag, 0, nlet_tag, 0, x, x); - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%so%d %so%d %lxVU %lx outlet}\n", + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%so%d %so%d %lxVU %s outlet}\n", canvas, xpos+x->x_gui.x_w+2-IOWIDTH, ypos + x->x_gui.x_h+3, xpos+x->x_gui.x_w+2, ypos + x->x_gui.x_h+4, - x, nlet_tag, 1, nlet_tag, 1, x, x); + x, nlet_tag, 1, nlet_tag, 1, x, nlet_tag); } if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist) { - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%si%d %si%d %lxVU %lx inlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%si%d %si%d %lxVU %s inlet}\n", canvas, xpos, ypos, xpos + IOWIDTH, ypos+1, - x, nlet_tag, 0, nlet_tag, 0, x, x); - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%si%d %si%d %lxVU %lx inlet}\n", + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%si%d %si%d %lxVU %s inlet}\n", canvas, xpos+x->x_gui.x_w+2-IOWIDTH, ypos, xpos+x->x_gui.x_w+2, ypos+1, - x, nlet_tag, 1, nlet_tag, 1, x, x); + x, nlet_tag, 1, nlet_tag, 1, x, nlet_tag); } x->x_updaterms = x->x_updatepeak = 1; sys_queuegui(x, x->x_gui.x_glist, vu_draw_update); @@ -208,18 +197,7 @@ static void vu_draw_move(t_vu *x, t_glist *glist) if (glist_isvisible(canvas)) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); int xpos=text_xpix(&x->x_gui.x_obj, glist); int ypos=text_ypix(&x->x_gui.x_obj, glist); @@ -296,34 +274,6 @@ static void vu_draw_erase(t_vu* x,t_glist* glist) sys_vgui("destroy %s\n", lh->h_pathname); sys_vgui(".x%lx.c delete %lxLABELH\n", canvas, x); } - -/* - sys_vgui(".x%lx.c delete %lxBASE\n", canvas, x); - for(i=1; i<=IEM_VU_STEPS; i++) - { - sys_vgui(".x%lx.c delete %lxRLED%d\n", canvas, x, i); - if(((i+2)&3) && (x->x_scale)) - sys_vgui(".x%lx.c delete %lxSCALE%d\n", canvas, x, i); - } - if(x->x_scale) - { - i=IEM_VU_STEPS+1; - sys_vgui(".x%lx.c delete %lxSCALE%d\n", canvas, x, i); - } - sys_vgui(".x%lx.c delete %lxPLED\n", canvas, x); - sys_vgui(".x%lx.c delete %lxRCOVER\n", canvas, x); - sys_vgui(".x%lx.c delete %lxLABEL\n", canvas, x); - if(!x->x_gui.x_fsf.x_snd_able) - { - sys_vgui(".x%lx.c delete %lxOUT%d\n", canvas, x, 0); - sys_vgui(".x%lx.c delete %lxOUT%d\n", canvas, x, 1); - } - if(!x->x_gui.x_fsf.x_rcv_able) - { - sys_vgui(".x%lx.c delete %lxIN%d\n", canvas, x, 0); - sys_vgui(".x%lx.c delete %lxIN%d\n", canvas, x, 1); - } -*/ } static void vu_draw_config(t_vu* x, t_glist* glist) @@ -395,31 +345,20 @@ static void vu_draw_io(t_vu* x, t_glist* glist, int old_snd_rcv_flags) if (glist_isvisible(canvas) && canvas == x->x_gui.x_glist) { - t_gobj *y = (t_gobj *)x; - t_object *ob = pd_checkobject(&y->g_pd); - - /* GOP objects are unable to call findrtext triggering consistency check error */ - t_rtext *yyyy = NULL; - if (!glist->gl_isgraph || glist_istoplevel(glist)) - yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); - - /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ - char *nlet_tag; - if (yyyy) nlet_tag = rtext_gettag(yyyy); - else nlet_tag = "bogus"; + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able) { - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%so%d %so%d %lxVU %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%so%d %so%d %lxVU %s outlet}\n", canvas, xpos, ypos + x->x_gui.x_h+3, xpos + IOWIDTH, ypos + x->x_gui.x_h+4, - x, nlet_tag, 0, nlet_tag, 0, x, x); - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%so%d %so%d %lxVU %lx outlet}\n", + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%so%d %so%d %lxVU %s outlet}\n", canvas, xpos+x->x_gui.x_w+2-IOWIDTH, ypos + x->x_gui.x_h+3, xpos+x->x_gui.x_w+2, ypos + x->x_gui.x_h+4, - x, nlet_tag, 1, nlet_tag, 1, x, x); + x, nlet_tag, 1, nlet_tag, 1, x, nlet_tag); } if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able) { @@ -428,16 +367,16 @@ static void vu_draw_io(t_vu* x, t_glist* glist, int old_snd_rcv_flags) } if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able) { - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%si%d %si%d %lxVU %lx outlet}\n", + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%si%d %si%d %lxVU %s outlet}\n", canvas, xpos, ypos, xpos + IOWIDTH, ypos+1, - x, nlet_tag, 0, nlet_tag, 0, x, x); - sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%si%d %si%d %lxVU %lx outlet}\n", + x, nlet_tag, 0, nlet_tag, 0, x, nlet_tag); + sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxVU%si%d %si%d %lxVU %s outlet}\n", canvas, xpos+x->x_gui.x_w+2-IOWIDTH, ypos, xpos+x->x_gui.x_w+2, ypos+1, - x, nlet_tag, 1, nlet_tag, 1, x, x); + x, nlet_tag, 1, nlet_tag, 1, x, nlet_tag); } if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) { @@ -462,6 +401,8 @@ static void vu_draw_select(t_vu* x,t_glist* glist) // if so, disable highlighting if (x->x_gui.x_glist == glist_getcanvas(glist)) { + char *nlet_tag = iem_get_tag(glist, (t_iemgui *)x); + sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke $select_color\n", canvas, x); for(i=1; i<=IEM_VU_STEPS; i++) { @@ -484,11 +425,11 @@ static void vu_draw_select(t_vu* x,t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVU %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVU %s}\n", canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w + 2 - SCALEHANDLE_WIDTH - 1, x->x_gui.x_obj.te_ypix + x->x_gui.x_h + 4 - SCALEHANDLE_HEIGHT - 1, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x, x); + sh->h_pathname, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", @@ -505,11 +446,11 @@ static void vu_draw_select(t_vu* x,t_glist* glist) sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxVU %lx}\n", + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxLABELH %lxVU %s}\n", canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x, x, x); + lh->h_pathname, x, x, x, nlet_tag); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", lh->h_pathname, lh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", diff --git a/pd/src/m_pd.h b/pd/src/m_pd.h index bb9c61ac71247c681af8855b3edc45c62b21c0a5..571177a48365311cc70f1c7986f67456f1a83a4f 100644 --- a/pd/src/m_pd.h +++ b/pd/src/m_pd.h @@ -11,7 +11,7 @@ extern "C" { #define PD_MAJOR_VERSION 0 #define PD_MINOR_VERSION 42 #define PD_BUGFIX_VERSION 7 -#define PD_TEST_VERSION "20130904" +#define PD_TEST_VERSION "20130906" #define PDL2ORK /* old name for "MSW" flag -- we have to take it for the sake of many old diff --git a/pd/src/pd.tk b/pd/src/pd.tk index d832538ee816f17f5b9ad7054c80a0f8b3ea913c..609fdf6d2a707add0fcdcde2cc99c5c828d70f2b 100644 --- a/pd/src/pd.tk +++ b/pd/src/pd.tk @@ -1809,10 +1809,9 @@ proc menu_close {name} { destroy $topname focus . } else { - set parent [menu_windowparent $name] + menu_windowparent $name pdtk_canvas_checkgeometry $name pd [concat $name menuclose 0 \;] - focus $parent } } @@ -3228,7 +3227,7 @@ proc pdtk_canvas_new {name width height geometry editable} { bind $name.c <Option-Motion> {pdtk_canvas_motion %W %x %y 4} } else { bind $name.c <Alt-Motion> {pdtk_canvas_motion %W %x %y 4} - } + } bind $name.c <Map> {pdtk_canvas_map %W} bind $name.c <Unmap> {pdtk_canvas_unmap %W} @@ -3979,7 +3978,7 @@ proc pdtk_select_all_gop_widgets {name gop state} { proc pdtk_tag_all_widgets_with_arrange {canvas object state} { #puts stderr "pdtk_select_all_gop_widgets $canvas $object $state" foreach item [$canvas find all] { - #puts stderr [$canvas gettags $item] + puts stderr [$canvas gettags $item] foreach tag [$canvas gettags $item] { if { [string first $object $tag] > -1 } { #puts stderr "...tag all match $tag" @@ -3994,13 +3993,13 @@ proc pdtk_tag_all_widgets_with_arrange {canvas object state} { } proc pdtk_find_lowest_widget_withtag_and_arrange {canvas name target objtag} { - #puts stderr "...pdtk_find_lowest_widget_withtag $canvas $name $target $objtag" + # puts stderr "...pdtk_find_lowest_widget_withtag $canvas $name $target $objtag" set arrange_lowest 0 foreach item [$canvas find all] { - #puts stderr "tags=[$canvas gettags $item]" + # puts stderr "tags=[$canvas gettags $item]" foreach tag [$canvas gettags $item] { if { [string first $name $tag] > -1 } { - #puts stderr "...match $tag" + # puts stderr "...match $tag" set arrange_lowest $tag break; } @@ -4011,20 +4010,17 @@ proc pdtk_find_lowest_widget_withtag_and_arrange {canvas name target objtag} { } #puts stderr "final_lowest=$tag" if { $arrange_lowest != 0 } { - if { $objtag == 0 } { - #puts stderr all_widgets - pdtk_tag_all_widgets_with_arrange $canvas $target 1 - } else { - #puts stderr one_object + if { $objtag != 0 } { + # puts stderr "one_object canvas=$canvas object=$objtag" $canvas addtag arrange withtag $objtag } $canvas raise arrange $canvas lower arrange $arrange_lowest - if { $objtag == 0} { - pdtk_tag_all_widgets_with_arrange $canvas $target 0 - } else { + if { $objtag != 0 } { $canvas dtag $objtag arrange + } else { + $canvas dtag all arrange } } } @@ -4631,12 +4627,12 @@ proc pdtk_canvas_motion {name x y mods} { # invisible (arg is ""). Invisibility means the Window Manager has minimized # us. We don't get a final "unmap" event when we destroy the window. proc pdtk_canvas_map {name} { - # puts stderr [concat map $name] + #puts stderr [concat map $name] pd [canvastosym $name] map 1 \; } proc pdtk_canvas_unmap {name} { - # puts stderr [concat unmap $name] + #puts stderr [concat unmap $name] pd [canvastosym $name] map 0 \; }