Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22254
Modified Files: Tag: devel_0_39 desire.c Log Message: deleted canvas_fixlinesfor
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.119 retrieving revision 1.1.2.120 diff -C2 -d -r1.1.2.119 -r1.1.2.120 *** desire.c 21 Aug 2006 03:13:05 -0000 1.1.2.119 --- desire.c 21 Aug 2006 03:34:05 -0000 1.1.2.120 *************** *** 304,309 **** }
! static void canvas_takeofflist(t_canvas *x) ! { if (x == canvas_list) canvas_list = x->gl_next; else { --- 304,308 ---- }
! static void canvas_takeofflist(t_canvas *x) { if (x == canvas_list) canvas_list = x->gl_next; else { *************** *** 315,337 ****
! void canvas_setargs(int argc, t_atom *argv) ! { ! /* if there's an old one lying around free it here. This ! happens if an abstraction is loaded but never gets as far ! as calling canvas_new(). */ ! if (canvas_newargv) ! freebytes(canvas_newargv, canvas_newargc * sizeof(t_atom)); canvas_newargc = argc; canvas_newargv = (t_atom *)copybytes(argv, argc * sizeof(t_atom)); }
! void glob_setfilename(void *dummy, t_symbol *filesym, t_symbol *dirsym) ! { canvas_newfilename = filesym; canvas_newdirectory = dirsym; }
! t_canvas *canvas_getcurrent(void) ! { return ((t_canvas *)pd_findbyclass(&s__X, canvas_class)); } --- 314,332 ----
! /* if there's an old one lying around free it here. This ! happens if an abstraction is loaded but never gets as far ! as calling canvas_new(). */ ! void canvas_setargs(int argc, t_atom *argv) { ! if (canvas_newargv) freebytes(canvas_newargv, canvas_newargc * sizeof(t_atom)); canvas_newargc = argc; canvas_newargv = (t_atom *)copybytes(argv, argc * sizeof(t_atom)); }
! void glob_setfilename(void *dummy, t_symbol *filesym, t_symbol *dirsym) { canvas_newfilename = filesym; canvas_newdirectory = dirsym; }
! t_canvas *canvas_getcurrent(void) { return ((t_canvas *)pd_findbyclass(&s__X, canvas_class)); } *************** *** 340,363 **** void canvas_unsetcurrent(t_canvas *x) { pd_popsym(&x->gl_pd);}
! t_canvasenvironment *canvas_getenv(t_canvas *x) ! { if (!x) bug("canvas_getenv"); ! while (!x->gl_env) ! if (!(x = x->gl_owner)) ! bug("t_canvasenvironment", x); ! return (x->gl_env); }
! int canvas_getdollarzero( void) ! { t_canvas *x = canvas_getcurrent(); t_canvasenvironment *env = (x ? canvas_getenv(x) : 0); ! if (env) ! return (env->ce_dollarzero); ! else return (0); }
! void canvas_getargs(int *argcp, t_atom **argvp) ! { t_canvasenvironment *e = canvas_getenv(canvas_getcurrent()); *argcp = e->ce_argc; --- 335,351 ---- void canvas_unsetcurrent(t_canvas *x) { pd_popsym(&x->gl_pd);}
! t_canvasenvironment *canvas_getenv(t_canvas *x) { if (!x) bug("canvas_getenv"); ! while (!x->gl_env) if (!(x = x->gl_owner)) bug("t_canvasenvironment", x); ! return x->gl_env; }
! int canvas_getdollarzero(void) { t_canvas *x = canvas_getcurrent(); t_canvasenvironment *env = (x ? canvas_getenv(x) : 0); ! return env ? env->ce_dollarzero : 0; }
! void canvas_getargs(int *argcp, t_atom **argvp) { t_canvasenvironment *e = canvas_getenv(canvas_getcurrent()); *argcp = e->ce_argc; *************** *** 365,382 **** }
! t_symbol *canvas_realizedollar(t_canvas *x, t_symbol *s) ! { t_symbol *ret; char *name = s->s_name; ! if (*name == '$' && name[1] >= '0' && name[1] <= '9') ! { t_canvasenvironment *env = canvas_getenv(x); canvas_setcurrent(x); ! ret = binbuf_realizedollsym(gensym(name+1), ! env->ce_argc, env->ce_argv, 1); canvas_unsetcurrent(x); } else ret = s; ! return (ret); }
--- 353,367 ---- }
! t_symbol *canvas_realizedollar(t_canvas *x, t_symbol *s) { t_symbol *ret; char *name = s->s_name; ! if (*name == '$' && name[1] >= '0' && name[1] <= '9') { t_canvasenvironment *env = canvas_getenv(x); canvas_setcurrent(x); ! ret = binbuf_realizedollsym(gensym(name+1), env->ce_argc, env->ce_argv, 1); canvas_unsetcurrent(x); } else ret = s; ! return ret; }
*************** *** 384,397 **** t_symbol *canvas_getdir(t_canvas *x) {return canvas_getenv( x)->ce_dir;}
! void canvas_makefilename(t_canvas *x, char *file, char *result, int resultsize) ! { char *dir = canvas_getenv(x)->ce_dir->s_name; ! if (file[0] == '/' || (file[0] && file[1] == ':') || !*dir) ! { strncpy(result, file, resultsize); result[resultsize-1] = 0; ! } ! else ! { int nleft; strncpy(result, dir, resultsize); --- 369,378 ---- t_symbol *canvas_getdir(t_canvas *x) {return canvas_getenv( x)->ce_dir;}
! void canvas_makefilename(t_canvas *x, char *file, char *result, int resultsize) { char *dir = canvas_getenv(x)->ce_dir->s_name; ! if (file[0] == '/' || (file[0] && file[1] == ':') || !*dir) { strncpy(result, file, resultsize); result[resultsize-1] = 0; ! } else { int nleft; strncpy(result, dir, resultsize); *************** *** 402,410 **** strncat(result, file, nleft); result[resultsize-1] = 0; ! } }
! void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir) ! { post("canvas_rename"); if (strcmp(x->gl_name->s_name, "Pd")) pd_unbind(&x->gl_pd, canvas_makebindsym(x->gl_name)); --- 383,390 ---- strncat(result, file, nleft); result[resultsize-1] = 0; ! } }
! void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir) { post("canvas_rename"); if (strcmp(x->gl_name->s_name, "Pd")) pd_unbind(&x->gl_pd, canvas_makebindsym(x->gl_name)); *************** *** 434,446 **** }
! t_outconnect *linetraverser_next(t_linetraverser *t) ! { t_outconnect *rval = t->tr_nextoc; int outno; ! while (!rval) ! { outno = t->tr_nextoutno; ! while (outno == t->tr_nout) ! { t_gobj *y; t_object *ob = 0; --- 414,423 ---- }
! t_outconnect *linetraverser_next(t_linetraverser *t) { t_outconnect *rval = t->tr_nextoc; int outno; ! while (!rval) { outno = t->tr_nextoutno; ! while (outno == t->tr_nout) { t_gobj *y; t_object *ob = 0; *************** *** 461,469 **** t->tr_nin = obj_ninlets(t->tr_ob2); if (!t->tr_nin) bug("drawline"); ! return (rval); }
! void linetraverser_skipobject(t_linetraverser *t) ! { t->tr_nextoc = 0; t->tr_nextoutno = t->tr_nout; --- 438,445 ---- t->tr_nin = obj_ninlets(t->tr_ob2); if (!t->tr_nin) bug("drawline"); ! return rval; }
! void linetraverser_skipobject(t_linetraverser *t) { t->tr_nextoc = 0; t->tr_nextoutno = t->tr_nout; *************** *** 509,514 **** /* (otherwise assume we're being created from the menu.) */
! if (canvas_newdirectory->s_name[0]) ! { static int dollarzero = 1000; t_canvasenvironment *env = x->gl_env = --- 485,489 ---- /* (otherwise assume we're being created from the menu.) */
! if (canvas_newdirectory->s_name[0]) { static int dollarzero = 1000; t_canvasenvironment *env = x->gl_env = *************** *** 543,554 **** abstraction inside another patch. A separate mechanism prevents the toplevel abstraction from showing up. */ ! if (vis && gensym("#X")->s_thing && ! ((*gensym("#X")->s_thing) == canvas_class)) ! { t_canvas *zzz = (t_canvas *)(gensym("#X")->s_thing); ! while (zzz && !zzz->gl_env) ! zzz = zzz->gl_owner; ! if (zzz && canvas_isabstraction(zzz) && zzz->gl_owner) ! vis = 0; } x->gl_willvis = vis; --- 518,525 ---- abstraction inside another patch. A separate mechanism prevents the toplevel abstraction from showing up. */ ! if (vis && gensym("#X")->s_thing && *gensym("#X")->s_thing == canvas_class) { t_canvas *zzz = (t_canvas *)(gensym("#X")->s_thing); ! while (zzz && !zzz->gl_env) zzz = zzz->gl_owner; ! if (zzz && canvas_isabstraction(zzz) && zzz->gl_owner) vis = 0; } x->gl_willvis = vis; *************** *** 557,573 **** pd_pushsym(&x->gl_pd); x->gl_next_add = -1; ! return(x); }
void canvas_setgraph(t_glist *x, int flag, int nogoprect);
! static void canvas_coords(t_glist *x, t_symbol *s, int argc, t_atom *argv) ! { pd_scanargs(argc,argv,"iiiiii;",&x->gl_x1,&x->gl_y1,&x->gl_x2,&x->gl_y2, &x->gl_pixwidth,&x->gl_pixheight); ! if (argc <= 7) ! canvas_setgraph(x, atom_getintarg(6, argc, argv), 1); ! else ! { x->gl_xmargin = atom_getintarg(7, argc, argv); x->gl_ymargin = atom_getintarg(8, argc, argv); --- 528,541 ---- pd_pushsym(&x->gl_pd); x->gl_next_add = -1; ! return x; }
void canvas_setgraph(t_glist *x, int flag, int nogoprect);
! static void canvas_coords(t_glist *x, t_symbol *s, int argc, t_atom *argv) { pd_scanargs(argc,argv,"iiiiii;",&x->gl_x1,&x->gl_y1,&x->gl_x2,&x->gl_y2, &x->gl_pixwidth,&x->gl_pixheight); ! if (argc <= 7) canvas_setgraph(x, atom_getintarg(6, argc, argv), 1); ! else { x->gl_xmargin = atom_getintarg(7, argc, argv); x->gl_ymargin = atom_getintarg(8, argc, argv); *************** *** 579,585 **** a "graph", not a text object. */ t_glist *glist_addglist(t_glist *g, t_symbol *sym, ! float x1, float y1, float x2, float y2, ! float px1, float py1, float px2, float py2) ! { static int gcount = 0; int zz; --- 547,552 ---- a "graph", not a text object. */ t_glist *glist_addglist(t_glist *g, t_symbol *sym, ! float x1, float y1, float x2, float y2, ! float px1, float py1, float px2, float py2) { static int gcount = 0; int zz; *************** *** 627,636 **** glist_add(g, &x->gl_gobj); if (glist_isvisible(g)) canvas_create_editor(x, 1); ! return (x); }
/* call glist_addglist from a Pd message */ ! void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv) ! { t_symbol *sym; float x1,y1,x2,y2,px1,py1,px2,py2; --- 594,602 ---- glist_add(g, &x->gl_gobj); if (glist_isvisible(g)) canvas_create_editor(x, 1); ! return x; }
/* call glist_addglist from a Pd message */ ! void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv) { t_symbol *sym; float x1,y1,x2,y2,px1,py1,px2,py2; *************** *** 639,651 **** }
! /* return true if the glist should appear as a graph on parent; ! otherwise it appears as a text box. */ ! int glist_isgraph(t_glist *x) ! { ! return (x->gl_isgraph); ! }
! /* This is sent from the GUI to inform a toplevel that its window has been ! moved or resized. */ static void canvas_setbounds(t_canvas *x, int x1, int y1, int x2, int y2) { --- 605,614 ---- }
! /* return true if the glist should appear as a graph on parent; ! otherwise it appears as a text box. */ ! int glist_isgraph(t_glist *x) {return x->gl_isgraph;}
! /* This is sent from the GUI to inform a toplevel that its window has been ! moved or resized. */ static void canvas_setbounds(t_canvas *x, int x1, int y1, int x2, int y2) { *************** *** 659,664 **** x->gl_screenx2 = x2; x->gl_screeny2 = y2; ! if (!glist_isgraph(x) && (x->gl_y2 < x->gl_y1)) ! { /* if it's flipped so that y grows upward, fix so that zero is bottom edge and redraw. This is --- 622,626 ---- x->gl_screenx2 = x2; x->gl_screeny2 = y2; ! if (!glist_isgraph(x) && (x->gl_y2 < x->gl_y1)) { /* if it's flipped so that y grows upward, fix so that zero is bottom edge and redraw. This is *************** *** 678,683 **** }
! t_symbol *canvas_makebindsym(t_symbol *s) ! { char buf[MAXPDSTRING]; sprintf(buf,"pd-%s",s->s_name); --- 640,644 ---- }
! t_symbol *canvas_makebindsym(t_symbol *s) { char buf[MAXPDSTRING]; sprintf(buf,"pd-%s",s->s_name); *************** *** 685,690 **** }
! void canvas_reflecttitle(t_canvas *x) ! {/* char namebuf[MAXPDSTRING]; char foo[MAXPDSTRING]; --- 646,651 ---- }
! void canvas_reflecttitle(t_canvas *x) { ! /* char namebuf[MAXPDSTRING]; char foo[MAXPDSTRING]; *************** *** 709,719 **** canvas_getdir(x)->s_name); sys_mgui(x,"window_title","s",gensym(foo)); ! */}
! void canvas_dirty(t_canvas *x, t_int n) ! { t_canvas *x2 = canvas_getrootfor(x); ! if ((unsigned)n != x2->gl_dirty) ! { x2->gl_dirty = n; canvas_reflecttitle(x2); --- 670,679 ---- canvas_getdir(x)->s_name); sys_mgui(x,"window_title","s",gensym(foo)); ! */ ! }
! void canvas_dirty(t_canvas *x, t_int n) { t_canvas *x2 = canvas_getrootfor(x); ! if ((unsigned)n != x2->gl_dirty) { x2->gl_dirty = n; canvas_reflecttitle(x2); *************** *** 721,729 **** }
! void canvas_drawredrect(t_canvas *x, int doit) ! { ! if (doit) ! sys_mgui(glist_getcanvas(x),"gop_rectangle","iiii", ! x->gl_xmargin, x->gl_ymargin, x->gl_pixwidth, x->gl_pixheight); else sys_mgui(glist_getcanvas(x),"gop_rectangle_delete",""); } --- 681,687 ---- }
! void canvas_drawredrect(t_canvas *x, int doit) { ! if (doit) sys_mgui(glist_getcanvas(x),"gop_rectangle","iiii", ! x->gl_xmargin, x->gl_ymargin, x->gl_pixwidth, x->gl_pixheight); else sys_mgui(glist_getcanvas(x),"gop_rectangle_delete",""); } *************** *** 764,769 **** }
! static t_editor *editor_new(t_glist *owner) ! { char buf[40]; t_editor *x = (t_editor *)getbytes(sizeof(*x)); --- 722,726 ---- }
! static t_editor *editor_new(t_glist *owner) { char buf[40]; t_editor *x = (t_editor *)getbytes(sizeof(*x)); *************** *** 776,781 **** }
! static void editor_free(t_editor *x, t_glist *y) ! { guiconnect_notarget(x->e_guiconnect, 1000); binbuf_free(x->e_connectbuf); --- 733,737 ---- }
! static void editor_free(t_editor *x, t_glist *y) { guiconnect_notarget(x->e_guiconnect, 1000); binbuf_free(x->e_connectbuf); *************** *** 784,813 **** }
! /* recursively create or destroy all editors of a glist and its ! sub-glists, as long as they aren't toplevels. */ ! void canvas_create_editor(t_glist *x, int createit) ! { t_gobj *y; t_object *ob; ! if (createit) ! { ! if (x->gl_editor) ! bug("canvas_create_editor"); ! else ! { x->gl_editor = editor_new(x); ! for (y = x->gl_list; y; y = y->g_next) { ob = pd_checkobject(&y->g_pd); if (ob) rtext_new(x, ob); } } ! } ! else ! { ! if (!x->gl_editor) ! bug("canvas_create_editor"); ! else ! { ! for (y = x->gl_list; y; y = y->g_next) { ob = pd_checkobject(&y->g_pd); if (ob) rtext_free(glist_findrtext(x, ob)); --- 740,761 ---- }
! /* recursively create or destroy all editors of a glist and its ! sub-glists, as long as they aren't toplevels. */ ! void canvas_create_editor(t_glist *x, int createit) { t_gobj *y; t_object *ob; ! if (createit) { ! if (x->gl_editor) bug("canvas_create_editor"); ! else { x->gl_editor = editor_new(x); ! glist_each(y,x) { ob = pd_checkobject(&y->g_pd); if (ob) rtext_new(x, ob); } } ! } else { ! if (!x->gl_editor) bug("canvas_create_editor"); ! else { ! glist_each(y,x) { ob = pd_checkobject(&y->g_pd); if (ob) rtext_free(glist_findrtext(x, ob)); *************** *** 817,824 **** } } ! for (y = x->gl_list; y; y = y->g_next) ! if (pd_class(&y->g_pd) == canvas_class && ! ((t_canvas *)y)->gl_isgraph) canvas_create_editor((t_canvas *)y, createit); }
--- 765,772 ---- } } ! glist_each(y,x) { ! if (pd_class(&y->g_pd) == canvas_class && ((t_canvas *)y)->gl_isgraph) canvas_create_editor((t_canvas *)y, createit); + } }
*************** *** 835,839 **** sys_mgui(x,"window_raise",""); sys_mgui(x,"window_focus",""); ! sys_mgui(x,"window_deiconify",""); #endif } else { --- 783,787 ---- sys_mgui(x,"window_raise",""); sys_mgui(x,"window_focus",""); ! sys_mgui(x,"window_deiconify",""); #endif } else { *************** *** 930,935 **** /* ----------------- lines ---------- */
! static void canvas_drawlines(t_canvas *x) ! { t_linetraverser t; t_outconnect *oc; --- 878,882 ---- /* ----------------- lines ---------- */
! static void canvas_drawlines(t_canvas *x) { t_linetraverser t; t_outconnect *oc; *************** *** 938,943 **** }
- void canvas_fixlinesfor(t_canvas *x, t_text *text) {sys_mgui(text,"draw_wires","");} - /* kill all lines for one inlet or outlet */ void canvas_deletelinesforio(t_canvas *x, t_text *text, t_inlet *inp, t_outlet *outp) --- 885,888 ---- *************** *** 1627,1631 **** { gobj_vis(&x->gl_gobj, x->gl_owner, 1); - canvas_fixlinesfor(x->gl_owner, &x->gl_obj); } } --- 1572,1575 ---- *************** *** 1658,1662 **** { gobj_vis(&x->gl_gobj, x->gl_owner, 1); - canvas_fixlinesfor(x->gl_owner, &x->gl_obj); } } --- 1602,1605 ---- *************** *** 1985,1989 **** (long)glist_getcanvas(x), 0, 0, 0, 0, (obj_issignaloutlet(objsrc, outno) ? 2 : 1),(long)oc); - canvas_fixlinesfor(x, objsrc); } newest = (t_pd *)oc; --- 1928,1931 ---- *************** *** 3669,3681 ****
! t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *s, t_symbol* h) ! { t_inlet *ip = inlet_new(&x->gl_obj, who, s, 0); inlet_settip(ip,h); ! if (!x->gl_loading && x->gl_owner && glist_isvisible(x->gl_owner)) ! { gobj_vis(&x->gl_gobj, x->gl_owner, 0); gobj_vis(&x->gl_gobj, x->gl_owner, 1); - canvas_fixlinesfor(x->gl_owner, &x->gl_obj); } if (!x->gl_loading) canvas_resortinlets(x); --- 3611,3620 ----
! t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *s, t_symbol* h) { t_inlet *ip = inlet_new(&x->gl_obj, who, s, 0); inlet_settip(ip,h); ! if (!x->gl_loading && x->gl_owner && glist_isvisible(x->gl_owner)) { gobj_vis(&x->gl_gobj, x->gl_owner, 0); gobj_vis(&x->gl_gobj, x->gl_owner, 1); } if (!x->gl_loading) canvas_resortinlets(x); *************** *** 3683,3701 **** }
! void canvas_rminlet(t_canvas *x, t_inlet *ip) ! { t_canvas *owner = x->gl_owner; ! int redraw = (owner && glist_isvisible(owner) && (!owner->gl_isdeleting) ! && glist_istoplevel(owner)); ! if (owner) canvas_deletelinesforio(owner, &x->gl_obj, ip, 0); ! if (redraw) ! gobj_vis(&x->gl_gobj, x->gl_owner, 0); inlet_free(ip); ! if (redraw) ! { ! gobj_vis(&x->gl_gobj, x->gl_owner, 1); ! canvas_fixlinesfor(x->gl_owner, &x->gl_obj); ! } }
--- 3622,3632 ---- }
! void canvas_rminlet(t_canvas *x, t_inlet *ip) { t_canvas *owner = x->gl_owner; ! int redraw = owner && glist_isvisible(owner) && !owner->gl_isdeleting && glist_istoplevel(owner); if (owner) canvas_deletelinesforio(owner, &x->gl_obj, ip, 0); ! if (redraw) gobj_vis(&x->gl_gobj, x->gl_owner, 0); inlet_free(ip); ! if (redraw) gobj_vis(&x->gl_gobj, x->gl_owner, 1); }
*************** *** 3703,3727 **** extern void obj_moveinletfirst(t_object *x, t_inlet *i);
! void canvas_resortinlets(t_canvas *x) ! { int ninlets = 0, i, j, xmax; t_gobj *y, **vec, **vp, **maxp; - for (ninlets = 0, y = x->gl_list; y; y = y->g_next) if (pd_class(&y->g_pd) == vinlet_class) ninlets++; - if (ninlets < 2) return; - vec = (t_gobj **)getbytes(ninlets * sizeof(*vec)); - for (y = x->gl_list, vp = vec; y; y = y->g_next) if (pd_class(&y->g_pd) == vinlet_class) *vp++ = y; ! ! for (i = ninlets; i--;) ! { t_inlet *ip; ! for (vp = vec, xmax = -0x7fffffff, maxp = 0, j = ninlets; ! j--; vp++) ! { int x1, y1, x2, y2; t_gobj *g = *vp; --- 3634,3649 ---- extern void obj_moveinletfirst(t_object *x, t_inlet *i);
! void canvas_resortinlets(t_canvas *x) { int ninlets = 0, i, j, xmax; t_gobj *y, **vec, **vp, **maxp; for (ninlets = 0, y = x->gl_list; y; y = y->g_next) if (pd_class(&y->g_pd) == vinlet_class) ninlets++; if (ninlets < 2) return; vec = (t_gobj **)getbytes(ninlets * sizeof(*vec)); for (y = x->gl_list, vp = vec; y; y = y->g_next) if (pd_class(&y->g_pd) == vinlet_class) *vp++ = y; ! for (i = ninlets; i--;) { t_inlet *ip; ! for (vp = vec, xmax = -0x7fffffff, maxp = 0, j = ninlets; j--; vp++) { int x1, y1, x2, y2; t_gobj *g = *vp; *************** *** 3734,3743 **** *maxp = 0; ip = vinlet_getit(&y->g_pd); - obj_moveinletfirst(&x->gl_obj, ip); } freebytes(vec, ninlets * sizeof(*vec)); - if (x->gl_owner && glist_isvisible(x->gl_owner)) - canvas_fixlinesfor(x->gl_owner, &x->gl_obj); }
--- 3656,3662 ---- *************** *** 3745,3753 **** { t_outlet *op = outlet_new(&x->gl_obj, s); ! if (!x->gl_loading && x->gl_owner && glist_isvisible(x->gl_owner)) ! { gobj_vis(&x->gl_gobj, x->gl_owner, 0); gobj_vis(&x->gl_gobj, x->gl_owner, 1); - canvas_fixlinesfor(x->gl_owner, &x->gl_obj); } if (!x->gl_loading) canvas_resortoutlets(x); --- 3664,3670 ---- { t_outlet *op = outlet_new(&x->gl_obj, s); ! if (!x->gl_loading && x->gl_owner && glist_isvisible(x->gl_owner)) { gobj_vis(&x->gl_gobj, x->gl_owner, 0); gobj_vis(&x->gl_gobj, x->gl_owner, 1); } if (!x->gl_loading) canvas_resortoutlets(x); *************** *** 3755,3774 **** }
! void canvas_rmoutlet(t_canvas *x, t_outlet *op) ! { t_canvas *owner = x->gl_owner; ! int redraw = (owner && glist_isvisible(owner) && (!owner->gl_isdeleting) ! && glist_istoplevel(owner)); ! if (owner) canvas_deletelinesforio(owner, &x->gl_obj, 0, op); ! if (redraw) ! gobj_vis(&x->gl_gobj, x->gl_owner, 0); ! outlet_free(op); ! if (redraw) ! { ! gobj_vis(&x->gl_gobj, x->gl_owner, 1); ! canvas_fixlinesfor(x->gl_owner, &x->gl_obj); ! } }
--- 3672,3682 ---- }
! void canvas_rmoutlet(t_canvas *x, t_outlet *op) { t_canvas *owner = x->gl_owner; ! int redraw = owner && glist_isvisible(owner) && (!owner->gl_isdeleting) && glist_istoplevel(owner); if (owner) canvas_deletelinesforio(owner, &x->gl_obj, 0, op); ! if (redraw) gobj_vis(&x->gl_gobj, x->gl_owner, 0); outlet_free(op); ! if (redraw) gobj_vis(&x->gl_gobj, x->gl_owner, 1); }
*************** *** 3776,3800 **** extern void obj_moveoutletfirst(t_object *x, t_outlet *i);
! void canvas_resortoutlets(t_canvas *x) ! { int noutlets = 0, i, j, xmax; t_gobj *y, **vec, **vp, **maxp; - for (noutlets = 0, y = x->gl_list; y; y = y->g_next) if (pd_class(&y->g_pd) == voutlet_class) noutlets++; - if (noutlets < 2) return; - vec = (t_gobj **)getbytes(noutlets * sizeof(*vec)); - for (y = x->gl_list, vp = vec; y; y = y->g_next) if (pd_class(&y->g_pd) == voutlet_class) *vp++ = y; ! ! for (i = noutlets; i--;) ! { t_outlet *ip; ! for (vp = vec, xmax = -0x7fffffff, maxp = 0, j = noutlets; ! j--; vp++) ! { int x1, y1, x2, y2; t_gobj *g = *vp; --- 3684,3699 ---- extern void obj_moveoutletfirst(t_object *x, t_outlet *i);
! void canvas_resortoutlets(t_canvas *x) { int noutlets = 0, i, j, xmax; t_gobj *y, **vec, **vp, **maxp; for (noutlets = 0, y = x->gl_list; y; y = y->g_next) if (pd_class(&y->g_pd) == voutlet_class) noutlets++; if (noutlets < 2) return; vec = (t_gobj **)getbytes(noutlets * sizeof(*vec)); for (y = x->gl_list, vp = vec; y; y = y->g_next) if (pd_class(&y->g_pd) == voutlet_class) *vp++ = y; ! for (i = noutlets; i--;) { t_outlet *ip; ! for (vp = vec, xmax = -0x7fffffff, maxp = 0, j = noutlets; j--; vp++) { int x1, y1, x2, y2; t_gobj *g = *vp; *************** *** 3807,3816 **** *maxp = 0; ip = voutlet_getit(&y->g_pd); - obj_moveoutletfirst(&x->gl_obj, ip); } freebytes(vec, noutlets * sizeof(*vec)); - if (x->gl_owner && glist_isvisible(x->gl_owner)) - canvas_fixlinesfor(x->gl_owner, &x->gl_obj); }
--- 3706,3712 ---- *************** *** 3818,3824 ****
! static void graph_bounds(t_glist *x, t_floatarg x1, t_floatarg y1, ! t_floatarg x2, t_floatarg y2) ! { x->gl_x1 = x1; x->gl_x2 = x2; --- 3714,3718 ----
! static void graph_bounds(t_glist *x, t_floatarg x1, t_floatarg y1, t_floatarg x2, t_floatarg y2) { x->gl_x1 = x1; x->gl_x2 = x2; *************** *** 4174,4188 **** }
! static void graph_displace(t_gobj *z, t_glist *glist, int dx, int dy) ! { t_glist *x = (t_glist *)z; ! if (!x->gl_isgraph) ! text_widgetbehavior.w_displacefn(z, glist, dx, dy); ! else ! { x->gl_obj.te_xpix += dx; x->gl_obj.te_ypix += dy; glist_redraw(x); - canvas_fixlinesfor(glist_getcanvas(glist), &x->gl_obj); } } --- 4068,4078 ---- }
! static void graph_displace(t_gobj *z, t_glist *glist, int dx, int dy) { t_glist *x = (t_glist *)z; ! if (!x->gl_isgraph) text_widgetbehavior.w_displacefn(z, glist, dx, dy); ! else { x->gl_obj.te_xpix += dx; x->gl_obj.te_ypix += dy; glist_redraw(x); } } *************** *** 9838,9842 **** static void iemgui_size(t_iemgui *x) { /*useless?*/ gobj_changed(x,0); - canvas_fixlinesfor(glist_getcanvas(x->glist), (t_text*)x); } static void iemgui_delta(t_iemgui *x, t_symbol *s, int ac, t_atom *av) { --- 9728,9731 ---- *************** *** 10814,10818 **** if(ac>1) vu_check_height(x, (int)atom_getintarg(1, ac, av)); gobj_changed(x,0); - if(glist_isvisible(x->glist)) canvas_fixlinesfor(glist_getcanvas(x->glist), (t_text*)x); }
--- 10703,10706 ----