Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18786
Modified Files:
Tag: desiredata
desire.c
Log Message:
implicit update upon subscribe
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.174
retrieving revision 1.1.2.217.2.175
diff -C2 -d -r1.1.2.217.2.174 -r1.1.2.217.2.175
*** desire.c 28 Jul 2007 14:40:27 -0000 1.1.2.217.2.174
--- desire.c 30 Jul 2007 16:00:17 -0000 1.1.2.217.2.175
***************
*** 119,127 ****
/* subscribing N spies takes N*N time, but it's not important for now */
! 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;
}
--- 119,128 ----
/* subscribing N spies takes N*N time, but it's not important for now */
! 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;
+ gobj_changed(self,0);
}
***************
*** 139,143 ****
if (self->dix->canvas) gobj_unsubscribe(self,self->dix->canvas);
self->dix->canvas = c;
! if (self->dix->canvas) { gobj_subscribe(self,self->dix->canvas); gobj_changed(self,0); }
}
--- 140,144 ----
if (self->dix->canvas) gobj_unsubscribe(self,self->dix->canvas);
self->dix->canvas = c;
! if (self->dix->canvas) gobj_subscribe(self,self->dix->canvas);
}
***************
*** 355,362 ****
x->gl_next = canvas_list;
canvas_list = x;
! if (x->havewindow || x->willvis) {
! gobj_subscribe(x,manager);
! gobj_changed(x,0);
! }
}
--- 356,360 ----
x->gl_next = canvas_list;
canvas_list = x;
! if (x->havewindow || x->willvis) gobj_subscribe(x,manager);
}
***************
*** 489,496 ****
x->xlabel = (t_symbol **)getbytes(0);
x->ylabel = (t_symbol **)getbytes(0);
! /*if (hack) { // only manage this canvas if it's not one of the 3 invisible builtin canvases
! gobj_subscribe(x,manager);
! gobj_changed(x,0); // could be made implicit
! }*/
return x;
}
--- 487,492 ----
x->xlabel = (t_symbol **)getbytes(0);
x->ylabel = (t_symbol **)getbytes(0);
! // only manage this canvas if it's not one of the 3 invisible builtin canvases
! /* if (hack) gobj_subscribe(x,manager); */
return x;
}
***************
*** 658,663 ****
if (f!=0 && !canvas_isvisible(x)) {
gobj_subscribe(x,manager);
! canvas_redraw(x);
! gobj_changed(x,0);
canvas_each(y,x) {
if (y->_class==canvas_class && canvas_getcanvas((t_canvas *)y)==x) canvas_map((t_canvas *)y,1);
--- 654,658 ----
if (f!=0 && !canvas_isvisible(x)) {
gobj_subscribe(x,manager);
! canvas_redraw(x); /* lazy update implies deleting this */
canvas_each(y,x) {
if (y->_class==canvas_class && canvas_getcanvas((t_canvas *)y)==x) canvas_map((t_canvas *)y,1);