Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26536
Modified Files: Tag: desiredata desire.c desire.h Log Message: disabling "object_insert" (used by Undo) for a few days; adding next_index field for future use
Index: desire.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v retrieving revision 1.1.2.49.2.38 retrieving revision 1.1.2.49.2.39 diff -C2 -d -r1.1.2.49.2.38 -r1.1.2.49.2.39 *** desire.h 31 Jul 2007 01:20:29 -0000 1.1.2.49.2.38 --- desire.h 3 Aug 2007 14:57:15 -0000 1.1.2.49.2.39 *************** *** 168,176 **** unsigned int mapped:1; /* true if, moreover, it's "mapped" */ unsigned int loading:1; /* am now loading from file */ ! unsigned int willvis:1; /* make me visible after loading */ unsigned int goprect:1; /* draw rectangle for graph-on-parent */ unsigned int isgraph:1; /* show as graph on parent */ unsigned int hidetext:1; /* hide object-name + args when doing graph on parent */ ! long next_add; /* insertion point for next call to canvas_add (for future use!?) */ };
--- 168,176 ---- unsigned int mapped:1; /* true if, moreover, it's "mapped" */ unsigned int loading:1; /* am now loading from file */ ! unsigned int willvis:1; /* make me visible after loading */ unsigned int goprect:1; /* draw rectangle for graph-on-parent */ unsigned int isgraph:1; /* show as graph on parent */ unsigned int hidetext:1; /* hide object-name + args when doing graph on parent */ ! long next_index; /* next index. to be incremented on each use */ };
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.185 retrieving revision 1.1.2.217.2.186 diff -C2 -d -r1.1.2.217.2.185 -r1.1.2.217.2.186 *** desire.c 3 Aug 2007 05:23:04 -0000 1.1.2.217.2.185 --- desire.c 3 Aug 2007 14:57:13 -0000 1.1.2.217.2.186 *************** *** 121,125 **** void gobj_subscribe(t_gobj *self, t_gobj *observer) { t_appendix *d = self->dix; ! for (int i=0; i<d->nobs; i++) if (d->obs[i]) return; d->obs=(t_gobj **)realloc(d->obs,sizeof(t_gobj *)*(1+d->nobs)); d->obs[d->nobs++] = observer; --- 121,125 ---- void gobj_subscribe(t_gobj *self, t_gobj *observer) { t_appendix *d = self->dix; ! for (size_t i=0; i<d->nobs; i++) if (d->obs[i]) return; d->obs=(t_gobj **)realloc(d->obs,sizeof(t_gobj *)*(1+d->nobs)); d->obs[d->nobs++] = observer; *************** *** 129,133 **** void gobj_unsubscribe (t_gobj *self, t_gobj *observer) { t_appendix *d = self->dix; ! int i; for (i=0; i<d->nobs; i++) if (d->obs[i]) break; if (i==d->nobs) return; --- 129,133 ---- void gobj_unsubscribe (t_gobj *self, t_gobj *observer) { t_appendix *d = self->dix; ! size_t i; for (i=0; i<d->nobs; i++) if (d->obs[i]) break; if (i==d->nobs) return; *************** *** 168,172 **** //std::cerr << "gobj_changed3 self=" << self << " origin=" << origin << " args={" << s.str().data()+(!!argc) << "}\n"; if (!d) {post("gobj_changed3: no appendix in %p",self); return;} ! for (int i=0; i<d->nobs; i++) { t_gobj *obs = d->obs[i]; t_notice ice = obs->_class->notice; --- 168,172 ---- //std::cerr << "gobj_changed3 self=" << self << " origin=" << origin << " args={" << s.str().data()+(!!argc) << "}\n"; if (!d) {post("gobj_changed3: no appendix in %p",self); return;} ! for (size_t i=0; i<d->nobs; i++) { t_gobj *obs = d->obs[i]; t_notice ice = obs->_class->notice; *************** *** 555,559 **** x->willvis = vis; x->font = 10 /*sys_nearestfontsize(font)*/; - x->next_add = -1; pd_pushsym(x); newest = x; --- 555,558 ---- *************** *** 2062,2076 **** y->g_next = 0; if (!x->list) x->list = y; else { ! if (x->next_add<0) { t_gobj *y2; for (y2 = x->list; y2->g_next; y2=y2->g_next) {} y2->g_next = y; ! } else { ! int i=0; ! t_gobj *y2; ! for (y2 = x->list; y2->g_next; y2=y2->g_next, i++) if (i==x->next_add) break; ! y->g_next = y2->g_next; ! y2->g_next = y; ! } } gobj_changed(x,"children"); --- 2061,2075 ---- y->g_next = 0; if (!x->list) x->list = y; else { ! //if (x->next_add<0) { t_gobj *y2; for (y2 = x->list; y2->g_next; y2=y2->g_next) {} y2->g_next = y; ! //} else { ! // int i=0; ! // t_gobj *y2; ! // for (y2 = x->list; y2->g_next; y2=y2->g_next, i++) if (i==x->next_add) break; ! // y->g_next = y2->g_next; ! // y2->g_next = y; ! //} } gobj_changed(x,"children"); *************** *** 5730,5733 **** --- 5729,5733 ----
/* this supposes that $2=#X */ + #if 0 static void canvas_object_insert(t_canvas *x, t_symbol *s, int argc, t_atom *argv) { //t_text *o; *************** *** 5742,5754 **** /* b = binbuf_new(); binbuf_restore(b, argc-5, argv+5); canvas_objtext(x,atom_getintarg(3,argc,argv),atom_getintarg(4,argc,argv),0,b); */ ! canvas_obj(x,s,argc-3,argv+3); ! } else if (s == gensym("restore")) { ! canvas_restore(x,s,argc-3,argv+3); ! } else if (s == gensym("floatatom")) { ! canvas_floatatom(x,s,argc-3,argv+3); ! } else if (s == gensym("symbolatom")) { ! canvas_floatatom(x,s,argc-3,argv+3); ! } else if (s == gensym("text")) { ! canvas_text(x,gensym("text"),argc-3,argv+3); } else post("UNSUPPORTED object_insert: %s",s->name); /* canvas_reorder_last(x,i); */ --- 5742,5750 ---- /* b = binbuf_new(); binbuf_restore(b, argc-5, argv+5); canvas_objtext(x,atom_getintarg(3,argc,argv),atom_getintarg(4,argc,argv),0,b); */ ! canvas_obj(x,s,argc-3,argv+3); ! } else if (s == gensym("restore")) { canvas_restore(x,s,argc-3,argv+3); ! } else if (s == gensym("floatatom")) { canvas_floatatom(x,s,argc-3,argv+3); ! } else if (s == gensym("symbolatom")) { canvas_floatatom(x,s,argc-3,argv+3); ! } else if (s == gensym("text")) { canvas_text(x,gensym("text"),argc-3,argv+3); } else post("UNSUPPORTED object_insert: %s",s->name); /* canvas_reorder_last(x,i); */ *************** *** 5757,5760 **** --- 5753,5757 ---- /*err: pd_popsym(x);*/ } + #endif
static void g_text_setup() { *************** *** 6914,6918 **** class_addmethod2(c,canvas_object_moveto,"object_moveto","sff"); class_addmethod2(c,canvas_object_delete,"object_delete","s"); ! class_addmethod2(c,canvas_object_insert,"object_insert","*"); class_addmethod2(c,canvas_object_get_tips,"object_get_tips","s"); class_addmethod2(c,canvas_object_help,"object_help","s"); --- 6911,6915 ---- class_addmethod2(c,canvas_object_moveto,"object_moveto","sff"); class_addmethod2(c,canvas_object_delete,"object_delete","s"); ! //class_addmethod2(c,canvas_object_insert,"object_insert","*"); class_addmethod2(c,canvas_object_get_tips,"object_get_tips","s"); class_addmethod2(c,canvas_object_help,"object_help","s");