Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20394
Modified Files: Tag: devel_0_39 desire.c desire.h Log Message: cleanup in text_save. cleanup in t_gatom code. more use of the macro glists_each (note the plural. that's the one that iterates the canvas_list)
Index: desire.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v retrieving revision 1.1.2.30 retrieving revision 1.1.2.31 diff -C2 -d -r1.1.2.30 -r1.1.2.31 *** desire.h 7 Sep 2006 01:54:53 -0000 1.1.2.30 --- desire.h 7 Sep 2006 05:14:56 -0000 1.1.2.31 *************** *** 249,264 **** EXTERN void word_free(t_word *wp, t_template *tmpl); EXTERN void scalar_redraw(t_scalar *x, t_glist *glist); - EXTERN int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap, t_symbol *elemtemplatesym, - float linewidth, float xloc, float xinc, float yloc, float scalarvis, - t_fielddesc *xfield, t_fielddesc *yfield, t_fielddesc *wfield, - int xpix, int ypix, int shift, int alt, int dbl, int doit); - EXTERN void array_getcoordinate(t_glist *glist, char *elem, int xonset, int yonset, int wonset, int indx, - float basex, float basey, float xinc, - t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, - float *xp, float *yp, float *wp); - EXTERN int array_getfields(t_symbol *elemtemplatesym, t_canvas **elemtemplatecanvasp, - t_template **elemtemplatep, int *elemsizep, - t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, - int *xonsetp, int *yonsetp, int *wonsetp); EXTERN t_template *template_new(t_symbol *sym, int argc, t_atom *argv); EXTERN void template_free(t_template *x); --- 249,252 ----
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.161 retrieving revision 1.1.2.162 diff -C2 -d -r1.1.2.161 -r1.1.2.162 *** desire.c 7 Sep 2006 01:54:52 -0000 1.1.2.161 --- desire.c 7 Sep 2006 05:14:55 -0000 1.1.2.162 *************** *** 1099,1105 **** /* public interface for above. */ void canvas_redrawallfortemplate(t_template *template, int action) { ! t_canvas *x; ! /* find all root canvases */ ! for (x = canvas_list; x; x = x->gl_next) glist_redrawall(x, action); }
--- 1099,1103 ---- /* public interface for above. */ void canvas_redrawallfortemplate(t_template *template, int action) { ! t_canvas *x; glists_each(x,canvas_list) glist_redrawall(x, action); }
*************** *** 1219,1227 **** }
- /* call canvas_doreload on everyone */ void canvas_reload(t_symbol *name, t_symbol *dir, t_gobj *except) { ! t_canvas *x; ! /* find all root canvases */ ! for (x = canvas_list; x; x = x->gl_next) glist_doreload(x, name, dir, except); }
--- 1217,1222 ---- }
void canvas_reload(t_symbol *name, t_symbol *dir, t_gobj *except) { ! t_canvas *x; glists_each(x,canvas_list) glist_doreload(x, name, dir, except); }
*************** *** 1411,1419 ****
void canvas_finderror(void *error_object) { ! t_canvas *x; ! /* find all root canvases */ ! for (x = canvas_list; x; x = x->gl_next) { ! if (glist_dofinderror(x, error_object)) return; ! } post("... sorry, I couldn't find the source of that error."); } --- 1406,1410 ----
void canvas_finderror(void *error_object) { ! t_canvas *x; glists_each(x,canvas_list) if (glist_dofinderror(x, error_object)) return; post("... sorry, I couldn't find the source of that error."); } *************** *** 1452,1456 **** glist_getindex(x, &t.to->ob_g), t.inlet); } - //binbuf_print(x->connectbuf); }
--- 1443,1446 ---- *************** *** 1892,1896 ****
/* routine to get screen coordinates of a point in an array */ ! void array_getcoordinate(t_glist *glist, char *elem, int xonset, int yonset, int wonset, int indx, float basex, float basey, float xinc, t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, --- 1882,1886 ----
/* routine to get screen coordinates of a point in an array */ ! static void array_getcoordinate(t_glist *glist, char *elem, int xonset, int yonset, int wonset, int indx, float basex, float basey, float xinc, t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, *************** *** 1999,2002 **** --- 1989,1997 ---- int shift, int alt, int dbl, int doit);
+ static int array_getfields(t_symbol *elemtemplatesym, t_canvas **elemtemplatecanvasp, + t_template **elemtemplatep, int *elemsizep, + t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, + int *xonsetp, int *yonsetp, int *wonsetp); + /* try clicking on an element of the array as a scalar (if clicking on the trace of the array failed) */ *************** *** 4713,4718 **** post("conforming template '%s' to new structure", tfrom->sym->s_name); for (i = 0; i < nto; i++) post("... %d", conformaction[i]); ! for (gl = canvas_list; gl; gl = gl->gl_next) ! template_conformglist(tfrom, tto, gl, conformaction); } freebytes(conformaction, sizeof(int) * nto); --- 4708,4712 ---- post("conforming template '%s' to new structure", tfrom->sym->s_name); for (i = 0; i < nto; i++) post("... %d", conformaction[i]); ! glists_each(gl,canvas_list) template_conformglist(tfrom, tto, gl, conformaction); } freebytes(conformaction, sizeof(int) * nto); *************** *** 5430,5434 **** /* get everything else you could possibly need about a plot, either for plot's own purposes or for plotting a "garray" */ ! int array_getfields(t_symbol *elemtemplatesym, t_canvas **elemtemplatecanvasp, t_template **elemtemplatep, int *elemsizep, t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, --- 5424,5428 ---- /* get everything else you could possibly need about a plot, either for plot's own purposes or for plotting a "garray" */ ! static int array_getfields(t_symbol *elemtemplatesym, t_canvas **elemtemplatecanvasp, t_template **elemtemplatep, int *elemsizep, t_fielddesc *xfielddesc, t_fielddesc *yfielddesc, t_fielddesc *wfielddesc, *************** *** 6983,7007 **** }
static void message_addcomma(t_message *x) { ! t_atom a; ! SETCOMMA(&a); binbuf_add(x->m_text.te_binbuf, 1, &a); gobj_changed(x->glist,0); } - - static void message_addsemi(t_message *x) {message_add(x,0,0,0);} - static void message_adddollar(t_message *x, t_floatarg f) { ! t_atom a; ! int n = f; ! if (n<0) n=0; ! SETDOLLAR(&a, n); binbuf_add(x->m_text.te_binbuf, 1, &a); gobj_changed(x->glist,0); } - static void message_adddollsym(t_message *x, t_symbol *s) { ! t_atom a; ! SETDOLLSYM(&a, s); binbuf_add(x->m_text.te_binbuf, 1, &a); gobj_changed(x->glist,0); --- 6977,6994 ---- }
+ static void message_addsemi(t_message *x) {message_add(x,0,0,0);} + static void message_addcomma(t_message *x) { ! t_atom a; SETCOMMA(&a); binbuf_add(x->m_text.te_binbuf, 1, &a); gobj_changed(x->glist,0); } static void message_adddollar(t_message *x, t_floatarg f) { ! t_atom a; SETDOLLAR(&a, f<0?0:f); binbuf_add(x->m_text.te_binbuf, 1, &a); gobj_changed(x->glist,0); } static void message_adddollsym(t_message *x, t_symbol *s) { ! t_atom a; SETDOLLSYM(&a, s); binbuf_add(x->m_text.te_binbuf, 1, &a); gobj_changed(x->glist,0); *************** *** 7042,7049 **** t_float max,min; t_symbol *label; /* symbol to show as label next to box */ ! t_symbol *a_symfrom;/* "receive" name -- bind ourselvs to this */ ! t_symbol *a_symto; /* "send" name -- send to this on output */ char wherelabel; /* 0-3 for left, right, above, below */ ! t_symbol *expanded_to; /* a_symto after $0, $1, ... expansion */ } t_gatom;
--- 7029,7036 ---- t_float max,min; t_symbol *label; /* symbol to show as label next to box */ ! t_symbol *rcv; ! t_symbol *snd; char wherelabel; /* 0-3 for left, right, above, below */ ! t_symbol *expanded_to; /* snd after $0, $1, ... expansion */ } t_gatom;
*************** *** 7089,7099 **** if (o) outlet_float(o, x->atom.a_w.w_float); if (*s->s_name && s->s_thing) { ! if (x->a_symto == x->a_symfrom) goto err; pd_float(s->s_thing, x->atom.a_w.w_float); } } else if (x->atom.a_type == A_SYMBOL) { if (o) outlet_symbol(o, x->atom.a_w.w_symbol); ! if (*x->a_symto->s_name && s->s_thing) { ! if (x->a_symto == x->a_symfrom) goto err; pd_symbol(s->s_thing, x->atom.a_w.w_symbol); } --- 7076,7086 ---- if (o) outlet_float(o, x->atom.a_w.w_float); if (*s->s_name && s->s_thing) { ! if (x->snd == x->rcv) goto err; pd_float(s->s_thing, x->atom.a_w.w_float); } } else if (x->atom.a_type == A_SYMBOL) { if (o) outlet_symbol(o, x->atom.a_w.w_symbol); ! if (*s->s_name && s->s_thing) { ! if (x->snd == x->rcv) goto err; pd_symbol(s->s_thing, x->atom.a_w.w_symbol); } *************** *** 7102,7106 **** err: pd_error(x, "%s: atom with same send/receive name (infinite loop)", ! x->a_symto->s_name); }
--- 7089,7093 ---- err: pd_error(x, "%s: atom with same send/receive name (infinite loop)", ! x->snd->s_name); }
*************** *** 7112,7146 **** /* message back from dialog window */ static void gatom_param(t_gatom *x, t_symbol *sel, int argc, t_atom *argv) { ! t_float width = atom_getfloatarg(0, argc, argv); ! t_float draglo = atom_getfloatarg(1, argc, argv); ! t_float draghi = atom_getfloatarg(2, argc, argv); ! t_symbol *label = gatom_unescapit(atom_getsymbolarg(3, argc, argv)); ! t_float wherelabel = atom_getfloatarg(4, argc, argv); ! t_symbol *symfrom = gatom_unescapit(atom_getsymbolarg(5, argc, argv)); ! t_symbol *symto = gatom_unescapit(atom_getsymbolarg(6, argc, argv)); t_text *t = (t_text *)x; ! ! if (!*symfrom->s_name && *x->a_symfrom->s_name) inlet_new(t, (t_pd *)t, 0, 0); ! else if (*symfrom->s_name && !*x->a_symfrom->s_name && t->te_inlet) { canvas_deletelinesforio(x->glist, t, t->te_inlet, 0); inlet_free(t->te_inlet); } ! if (!*symto->s_name && *x->a_symto->s_name) outlet_new(&x->a_text, 0); ! else if (*symto->s_name && !*x->a_symto->s_name && t->te_outlet) { canvas_deletelinesforio(x->glist, t, 0, t->te_outlet); outlet_free(t->te_outlet); } ! if (draglo >= draghi) draglo = draghi = 0; ! x->min = draglo; ! x->max = draghi; if (width < 0) width = 4; else if (width > 80) width = 80; x->a_text.te_width = width; x->wherelabel = ((int)wherelabel & 3); x->label = label; ! if (*x->a_symfrom->s_name) pd_unbind((t_pd *)x, canvas_realizedollar(x->glist, x->a_symfrom)); ! x->a_symfrom = symfrom; ! if (*x->a_symfrom->s_name) pd_bind( (t_pd *)x, canvas_realizedollar(x->glist, x->a_symfrom)); ! x->a_symto = symto; ! x->expanded_to = canvas_realizedollar(x->glist, x->a_symto); gobj_changed(x,0); } --- 7099,7131 ---- /* message back from dialog window */ static void gatom_param(t_gatom *x, t_symbol *sel, int argc, t_atom *argv) { ! t_float width,min,max,wherelabel; ! t_symbol *label,*rcv,*snd; t_text *t = (t_text *)x; ! pd_scanargs(argc,argv,"fffsfss",&width,&min,&max,&label,&wherelabel,&rcv,&snd); ! label = gatom_unescapit(label); ! rcv = gatom_unescapit(rcv); ! snd = gatom_unescapit(snd); ! if (!*rcv->s_name && *x->rcv->s_name) inlet_new(t, (t_pd *)t, 0, 0); ! else if (*rcv->s_name && !*x->rcv->s_name && t->te_inlet) { canvas_deletelinesforio(x->glist, t, t->te_inlet, 0); inlet_free(t->te_inlet); } ! if (!*snd->s_name && *x->snd->s_name) outlet_new(&x->a_text, 0); ! else if (*snd->s_name && !*x->snd->s_name && t->te_outlet) { canvas_deletelinesforio(x->glist, t, 0, t->te_outlet); outlet_free(t->te_outlet); } ! if (min>=max) min=max=0; ! x->min=min; ! x->max=max; if (width < 0) width = 4; else if (width > 80) width = 80; x->a_text.te_width = width; x->wherelabel = ((int)wherelabel & 3); x->label = label; ! if (*x->rcv->s_name) pd_unbind((t_pd *)x, canvas_realizedollar(x->glist, x->rcv)); ! x->rcv = rcv; ! if (*x->rcv->s_name) pd_bind( (t_pd *)x, canvas_realizedollar(x->glist, x->rcv)); ! x->snd = snd; ! x->expanded_to = canvas_realizedollar(x->glist, x->snd); gobj_changed(x,0); } *************** *** 7155,7164 **** x->atom.a_type = type; x->toggle = 1; ! x->min = 0; ! x->max = 0; x->wherelabel = 0; x->label = &s_; ! x->a_symfrom = &s_; ! x->a_symto = x->expanded_to = &s_; if (type == A_FLOAT) { x->atom.a_w.w_float = 0; --- 7140,7148 ---- x->atom.a_type = type; x->toggle = 1; ! x->min = x->max = 0; x->wherelabel = 0; x->label = &s_; ! x->rcv = &s_; ! x->snd = x->expanded_to = &s_; if (type == A_FLOAT) { x->atom.a_w.w_float = 0; *************** *** 7172,7195 **** binbuf_add(x->a_text.te_binbuf, 1, &at); if (argc > 1) { ! /* create from file. x, y, width, low-range, high-range, flags, ! label, receive-name, send-name */ x->a_text.te_xpix = atom_getfloatarg(0, argc, argv); x->a_text.te_ypix = atom_getfloatarg(1, argc, argv); ! x->a_text.te_width = atom_getintarg(2, argc, argv); ! /* sanity check because some very old patches have trash in this ! field... remove this in 2003 or so: */ ! if (x->a_text.te_width < 0 || x->a_text.te_width > 500) x->a_text.te_width = 4; ! x->min = atom_getfloatarg(3, argc, argv); ! x->max = atom_getfloatarg(4, argc, argv); ! x->wherelabel = (((int)atom_getfloatarg(5, argc, argv)) & 3); ! x->label = gatom_unescapit(atom_getsymbolarg(6, argc, argv)); ! x->a_symfrom = gatom_unescapit(atom_getsymbolarg(7, argc, argv)); ! if (*x->a_symfrom->s_name) ! pd_bind(&x->a_text.te_pd, canvas_realizedollar(x->glist, x->a_symfrom)); ! ! x->a_symto = gatom_unescapit(atom_getsymbolarg(8, argc, argv)); ! x->expanded_to = canvas_realizedollar(x->glist, x->a_symto); ! if (x->a_symto == &s_) outlet_new(&x->a_text, x->atom.a_type == A_FLOAT ? &s_float: &s_symbol); ! if (x->a_symfrom == &s_) inlet_new(&x->a_text, &x->a_text.te_pd, 0, 0); glist_add(gl, &x->a_text.te_g); } else { --- 7156,7173 ---- binbuf_add(x->a_text.te_binbuf, 1, &at); if (argc > 1) { ! float width; ! char wherelabel; x->a_text.te_xpix = atom_getfloatarg(0, argc, argv); x->a_text.te_ypix = atom_getfloatarg(1, argc, argv); ! pd_scanargs(argc-2,argv+2,"fffsfss",&width,&x->min,&x->max,&x->label,&wherelabel,&x->rcv,&x->snd); ! x->a_text.te_width = (width<0||width>500) ? 4 : width; ! x->wherelabel = wherelabel&3; ! x->label = gatom_unescapit(x->label); ! x->rcv = gatom_unescapit(x->rcv); ! if (*x->rcv->s_name) pd_bind(&x->a_text.te_pd, canvas_realizedollar(x->glist, x->rcv)); ! x->snd = gatom_unescapit(x->snd); ! x->expanded_to = canvas_realizedollar(x->glist, x->snd); ! if (x->snd == &s_) outlet_new(&x->a_text, x->atom.a_type == A_FLOAT ? &s_float: &s_symbol); ! if (x->rcv == &s_) inlet_new(&x->a_text, &x->a_text.te_pd, 0, 0); glist_add(gl, &x->a_text.te_g); } else { *************** *** 7210,7236 ****
static void gatom_free(t_gatom *x) { ! if (*x->a_symfrom->s_name) pd_unbind((t_pd *)x, canvas_realizedollar(x->glist, x->a_symfrom)); gfxstub_deleteforkey(x); }
! static void text_vis(t_gobj *z, t_glist *glist, int vis) { ! t_text *x = (t_text *)z; ! gobj_changed(x,0); }
void text_save(t_gobj *z, t_binbuf *b) { t_text *x = (t_text *)z; if (x->te_type == T_OBJECT) { if (zgetfn(&x->te_pd, gensym("saveto")) && ! !((pd_class(&x->te_pd) == canvas_class) && ! (canvas_isabstraction((t_canvas *)x) ! || canvas_istable((t_canvas *)x)))) ! { mess1(&x->te_pd, gensym("saveto"), b); ! binbuf_addv(b, "ssii", gensym("#X"), gensym("restore"), ! (t_int)x->te_xpix, (t_int)x->te_ypix); } else { ! binbuf_addv(b, "ssii", gensym("#X"), gensym("obj"), ! (t_int)x->te_xpix, (t_int)x->te_ypix); } if (x->te_binbuf) { --- 7188,7209 ----
static void gatom_free(t_gatom *x) { ! if (*x->rcv->s_name) pd_unbind((t_pd *)x, canvas_realizedollar(x->glist, x->rcv)); gfxstub_deleteforkey(x); }
! void canvas_saverestoreto(t_canvas *x, t_binbuf *b) { ! }
void text_save(t_gobj *z, t_binbuf *b) { t_text *x = (t_text *)z; + t_canvas *c = (t_canvas *)z; /* in case it is */ if (x->te_type == T_OBJECT) { if (zgetfn(&x->te_pd, gensym("saveto")) && ! !(pd_class(&x->te_pd)==canvas_class && (canvas_isabstraction(c) || canvas_istable(c)))) { mess1(&x->te_pd, gensym("saveto"), b); ! binbuf_addv(b, "ssii", gensym("#X"), gensym("restore"), (t_int)x->te_xpix, (t_int)x->te_ypix); } else { ! binbuf_addv(b, "ssii", gensym("#X"), gensym("obj"), (t_int)x->te_xpix, (t_int)x->te_ypix); } if (x->te_binbuf) { *************** *** 7239,7268 **** bug("binbuf missing at #X restore !!!"); } - binbuf_addv(b, ";"); } else if (x->te_type == T_MESSAGE) { ! binbuf_addv(b, "ssii", gensym("#X"), gensym("msg"), ! (t_int)x->te_xpix, (t_int)x->te_ypix); binbuf_addbinbuf(b, x->te_binbuf); - binbuf_addv(b, ";"); } else if (x->te_type == T_ATOM) { ! t_atomtype t = ((t_gatom *)x)->atom.a_type; ! t_symbol *sel = (t == A_SYMBOL ? gensym("symbolatom") : ! (t == A_FLOAT ? gensym("floatatom") : gensym("intatom"))); ! t_symbol *label = gatom_escapit(((t_gatom *)x)->label); ! t_symbol *symfrom = gatom_escapit(((t_gatom *)x)->a_symfrom); ! t_symbol *symto = gatom_escapit(((t_gatom *)x)->a_symto); ! binbuf_addv(b, "ssiiifffsss", gensym("#X"), sel, ! (t_int)x->te_xpix, (t_int)x->te_ypix, (t_int)x->te_width, ! (double)((t_gatom *)x)->min, ! (double)((t_gatom *)x)->max, ! (double)((t_gatom *)x)->wherelabel, ! label, symfrom, symto); ! binbuf_addv(b, ";"); ! } else { ! binbuf_addv(b, "ssii", gensym("#X"), gensym("text"), ! (t_int)x->te_xpix, (t_int)x->te_ypix); binbuf_addbinbuf(b, x->te_binbuf); - binbuf_addv(b, ";"); } appendix_save(z,b); } --- 7212,7230 ---- bug("binbuf missing at #X restore !!!"); } } else if (x->te_type == T_MESSAGE) { ! binbuf_addv(b, "ssii", gensym("#X"), gensym("msg"), (t_int)x->te_xpix, (t_int)x->te_ypix); binbuf_addbinbuf(b, x->te_binbuf); } else if (x->te_type == T_ATOM) { ! t_gatom *g; ! t_atomtype t = g->atom.a_type; ! t_symbol *sel = t==A_SYMBOL? gensym("symbolatom") : gensym("floatatom"); ! binbuf_addv(b, "ssiiifffsss", gensym("#X"), sel, (t_int)x->te_xpix, (t_int)x->te_ypix, ! (t_int)x->te_width, (double)g->min, (double)g->max, (double)g->wherelabel, ! gatom_escapit(g->label), gatom_escapit(g->rcv), gatom_escapit(g->snd)); ! } else { /* comment */ ! binbuf_addv(b, "ssii", gensym("#X"), gensym("text"), (t_int)x->te_xpix, (t_int)x->te_ypix); binbuf_addbinbuf(b, x->te_binbuf); } + binbuf_addv(b, ";"); appendix_save(z,b); } *************** *** 7274,7281 **** t_atom *vec1, *vec2; binbuf_text(b, buf, bufsize); ! natom1 = binbuf_getnatom(x->te_binbuf); ! vec1 = binbuf_getvec(x->te_binbuf); ! natom2 = binbuf_getnatom(b); ! vec2 = binbuf_getvec(b); /* special case: if pd args change just pass the message on. */ if (natom1 >= 1 && natom2 >= 1 && --- 7236,7241 ---- t_atom *vec1, *vec2; binbuf_text(b, buf, bufsize); ! natom1 = binbuf_getnatom(x->te_binbuf); vec1 = binbuf_getvec(x->te_binbuf); ! natom2 = binbuf_getnatom(b); vec2 = binbuf_getvec(b); /* special case: if pd args change just pass the message on. */ if (natom1 >= 1 && natom2 >= 1 && *************** *** 7427,7440 **** t_symbol *rcv = canvas_realizedollar(x->glist, s); if (rcv==s_empty) rcv=0; ! if(rcv) { ! if(rcv!=x->rcv) { ! if(x->rcv) pd_unbind((t_pd *)x, x->rcv); ! x->rcv = rcv; ! pd_bind((t_pd *)x, x->rcv); ! } ! } else if(!rcv && x->rcv) { ! pd_unbind((t_pd *)x, x->rcv); ! x->rcv = rcv; ! } gobj_changed(x,"rcv"); } --- 7387,7394 ---- t_symbol *rcv = canvas_realizedollar(x->glist, s); if (rcv==s_empty) rcv=0; ! if (rcv==x->rcv) return; ! if(x->rcv) pd_unbind((t_pd *)x, x->rcv); ! x->rcv = rcv; ! if(rcv) pd_bind((t_pd *)x, x->rcv); gobj_changed(x,"rcv"); } *************** *** 7605,7609 **** char *s; t_text *x = (t_text *)self; - #if 1 if (c==canvas_class) { /* just the "#N canvas" line, not the contents */ --- 7559,7562 ---- *************** *** 7621,7649 **** c->c_savefn(self,b); } - #endif - #if 0 - /* adapted from text_save. sorry */ - if (x->te_type == T_OBJECT && zgetfn(&x->te_pd, gensym("saveto")) && - !((pd_class(&x->te_pd) == canvas_class) && - (canvas_isabstraction((t_canvas *)x) - || canvas_istable((t_canvas *)x)))) { - mess1(&x->te_pd, gensym("saveto"), b); - binbuf_addv(b, "ssii", gensym("#X"), gensym("restore"), - (t_int)x->te_xpix, (t_int)x->te_ypix); - if (x->te_binbuf) { - binbuf_addbinbuf(b, x->te_binbuf); - } else { - bug("binbuf missing at #X restore !!!"); - } - binbuf_addv(b, ";"); - } else { - c->c_savefn(self,b); - } - #endif - binbuf_gettext(b,&s,&n); if (s[n-1]=='\n') n--; ! sys_vgui("update_object x%lx {%.*s} %d %d\n", ! (long)self,n,s, obj_ninlets((t_text *)self), obj_noutlets((t_text *)self)); --- 7574,7580 ---- c->c_savefn(self,b); } binbuf_gettext(b,&s,&n); if (s[n-1]=='\n') n--; ! sys_vgui("update_object x%lx {%.*s} %d %d\n",(long)self,n,s, obj_ninlets((t_text *)self), obj_noutlets((t_text *)self)); *************** *** 7893,7898 **** }
! static void toggle_float(t_toggle *x, t_floatarg f) {toggle_set(x, f); if(iemgui_forward(x)) toggle_action(x);} ! static void toggle_fout (t_toggle *x, t_floatarg f) {toggle_set(x, f); toggle_action(x);} static void toggle_loadbang(t_toggle *x) {if(iemgui_loadbang(x)) toggle_fout(x, (float)x->on);}
--- 7824,7829 ---- }
! static void toggle_float(t_toggle *x, t_floatarg f) {toggle_set(x,f);if(iemgui_forward(x)) toggle_action(x);} ! static void toggle_fout (t_toggle *x, t_floatarg f) {toggle_set(x,f); toggle_action(x);} static void toggle_loadbang(t_toggle *x) {if(iemgui_loadbang(x)) toggle_fout(x, (float)x->on);}
*************** *** 8003,8008 **** if (isdial) { /* compatibility with earlier "hdial" behavior */ ! if(x->change && i!=x->on_old && (!forwardonly || iemgui_forward(x))) ! radio_send2(x,x->on_old,0.0); x->on_old = x->on; x->on = i; --- 7934,7938 ---- if (isdial) { /* compatibility with earlier "hdial" behavior */ ! if(x->change && i!=x->on_old && (!forwardonly || iemgui_forward(x))) radio_send2(x,x->on_old,0.0); x->on_old = x->on; x->on = i; *************** *** 8076,8080 **** CLAMP(x->on,0,x->number-1); x->on_old = x->on = x->isa&1 ? x->on : 0; ! outlet_new(&x->obj, &s_list); radio_reload(x,0,argc,argv); return x; --- 8006,8010 ---- CLAMP(x->on,0,x->number-1); x->on_old = x->on = x->isa&1 ? x->on : 0; ! outlet_new((t_text *)x, &s_list); radio_reload(x,0,argc,argv); return x; *************** *** 8177,8191 **** static void slider_log(t_slider *x) {x->is_log=1; slider_check_minmax(x);} static void slider_steady(t_slider *x, t_floatarg f) {x->steady = !!f;} ! static void slider_float(t_slider *x, t_floatarg f) ! {slider_set(x, f); if(iemgui_forward(x)) slider_bang(x);} ! static void slider_loadbang(t_slider *x) ! {if(iemgui_loadbang(x)) slider_bang(x);}
static int slider_pickle(t_slider *x, t_foo *foo) { return pd_pickle(foo, "iiddbiaaaiiiiccci;b", ! &x->w,&x->h,&x->min,&x->max,&x->is_log,&x->isa, ! &x->snd,&x->rcv,&x->lab, ! &x->ldx,&x->ldy,&x->font_style,&x->fontsize, ! &x->bcol,&x->fcol,&x->lcol,&x->val,&x->steady); }
--- 8107,8117 ---- static void slider_log(t_slider *x) {x->is_log=1; slider_check_minmax(x);} static void slider_steady(t_slider *x, t_floatarg f) {x->steady = !!f;} ! static void slider_float(t_slider *x, t_floatarg f) {slider_set(x,f);if(iemgui_forward(x))slider_bang(x);} ! static void slider_loadbang(t_slider *x) {if(iemgui_loadbang(x)) slider_bang(x);}
static int slider_pickle(t_slider *x, t_foo *foo) { return pd_pickle(foo, "iiddbiaaaiiiiccci;b", ! &x->w,&x->h,&x->min,&x->max,&x->is_log,&x->isa,&x->snd,&x->rcv,&x->lab, ! &x->ldx,&x->ldy,&x->font_style,&x->fontsize,&x->bcol,&x->fcol,&x->lcol,&x->val,&x->steady); }
*************** *** 8217,8221 **** x->max=(double)(IEM_SL_DEFAULTSIZE-1); if (isvert(x)) x->h=IEM_SL_DEFAULTSIZE; else x->w=IEM_SL_DEFAULTSIZE; ! outlet_new(&x->obj, &s_float); slider_reload(x,0,argc,argv); return x; --- 8143,8147 ---- x->max=(double)(IEM_SL_DEFAULTSIZE-1); if (isvert(x)) x->h=IEM_SL_DEFAULTSIZE; else x->w=IEM_SL_DEFAULTSIZE; ! outlet_new((t_text *)x, &s_float); slider_reload(x,0,argc,argv); return x; *************** *** 8272,8281 **** static void nbbang(t_nbx *x) { outlet_float(x->obj.ob_outlet, x->val); ! if(x->snd && x->snd->s_thing) ! pd_float(x->snd->s_thing, x->val); }
! static void nbset(t_nbx *x, t_floatarg f) ! {x->val=f; nbclip(x); gobj_changed(x,0);}
static void nblog_height(t_nbx *x, t_floatarg lh) { --- 8198,8206 ---- static void nbbang(t_nbx *x) { outlet_float(x->obj.ob_outlet, x->val); ! if(x->snd && x->snd->s_thing) pd_float(x->snd->s_thing, x->val); }
! static void nbset(t_nbx *x, t_floatarg f) {x->val=f; nbclip(x); gobj_changed(x,0);} ! static void nbfloat(t_nbx *x, t_floatarg f) {nbset(x, f); if(iemgui_forward(x)) nbbang(x);}
static void nblog_height(t_nbx *x, t_floatarg lh) { *************** *** 8284,8290 **** }
- static void nbfloat(t_nbx *x, t_floatarg f) - {nbset(x, f); if(iemgui_forward(x)) nbbang(x);} - static void nbsize(t_nbx *x, t_symbol *s, int ac, t_atom *av) { x->w = MAX(1,(int)atom_getintarg(0, ac, av)); --- 8209,8212 ---- *************** *** 8445,8450 **** static void *vu_new(t_symbol *s, int argc, t_atom *argv) { t_vu *x = (t_vu *)iemgui_new(vu_class); ! x->out_rms = outlet_new(&x->obj, &s_float); ! x->out_peak = outlet_new(&x->obj, &s_float); x->h=IEM_VU_STEPS*3; x->scale = 1; --- 8367,8372 ---- static void *vu_new(t_symbol *s, int argc, t_atom *argv) { t_vu *x = (t_vu *)iemgui_new(vu_class); ! x->out_rms = outlet_new((t_text *)x, &s_float); ! x->out_peak = outlet_new((t_text *)x, &s_float); x->h=IEM_VU_STEPS*3; x->scale = 1; *************** *** 8452,8456 **** x->fp = x->fr = -101.0; vu_check_height(x, x->h); ! inlet_new(&x->obj, &x->obj.ob_pd, &s_float, gensym("ft1")); vu_reload(x,0,argc,argv); return x; --- 8374,8378 ---- x->fp = x->fr = -101.0; vu_check_height(x, x->h); ! inlet_new((t_text *)x, (t_pd *)x, &s_float, gensym("ft1")); vu_reload(x,0,argc,argv); return x; *************** *** 8475,8480 **** static void cnv_get_pos(t_cnv *x) { if(x->snd && x->snd->s_thing) { ! x->at[0].a_w.w_float = text_xpix(&x->obj, x->glist); ! x->at[1].a_w.w_float = text_ypix(&x->obj, x->glist); pd_list(x->snd->s_thing, &s_list, 2, x->at); } --- 8397,8402 ---- static void cnv_get_pos(t_cnv *x) { if(x->snd && x->snd->s_thing) { ! x->at[0].a_w.w_float = text_xpix((t_text *)x, x->glist); ! x->at[1].a_w.w_float = text_ypix((t_text *)x, x->glist); pd_list(x->snd->s_thing, &s_list, 2, x->at); } *************** *** 8860,8864 **** }
- void canvas_menuclose(t_canvas *x, t_floatarg fforce); /* properly close all open root canvases */ void glob_closeall(void *dummy, t_floatarg fforce) { --- 8782,8785 ----