[PD-cvs] pd/src desire.c,1.1.2.217.2.126,1.1.2.217.2.127
Mathieu Bouchard
matju at users.sourceforge.net
Thu Jan 11 23:01:48 CET 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063
Modified Files:
Tag: desiredata
desire.c
Log Message:
doesn't upload more objects than necessary.
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.126
retrieving revision 1.1.2.217.2.127
diff -C2 -d -r1.1.2.217.2.126 -r1.1.2.217.2.127
*** desire.c 11 Jan 2007 20:02:08 -0000 1.1.2.217.2.126
--- desire.c 11 Jan 2007 22:01:43 -0000 1.1.2.217.2.127
***************
*** 661,668 ****
static void graph_vis(t_gobj *gr, int vis);
static void canvas_redraw(t_canvas *x) {
gobj_changed(x,0);
canvas_each(y,x) {
! if (y->_class==canvas_class) canvas_redraw((t_canvas *)y); else gobj_changed(y,0);
}
}
--- 661,674 ----
static void graph_vis(t_gobj *gr, int vis);
+ /* this goes with the question: should gobj_changed(x,0) be recursive on a canvas?
+ if yes, then canvas_redraw should be merged into gobj_changed. */
static void canvas_redraw(t_canvas *x) {
+ post("canvas isvisible %d",canvas_isvisible(x));
+ if (!canvas_isvisible(x)) return;
gobj_changed(x,0);
canvas_each(y,x) {
! if (y->_class==canvas_class) {
! canvas_redraw((t_canvas *)y);
! } else gobj_changed(y,0);
}
}
***************
*** 699,703 ****
if (f!=0 && !canvas_isvisible(x)) {
gobj_subscribe(x,manager);
! gobj_changed(x,0); canvas_each(y,x) gobj_changed(y,0); // could be made implicit
canvas_wires_each(oc,t,x) gobj_changed(oc,0); // this too
}
--- 705,714 ----
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);
! gobj_changed(y,0); // could be made implicit
! }
canvas_wires_each(oc,t,x) gobj_changed(oc,0); // this too
}
***************
*** 707,712 ****
--- 718,726 ----
static void canvas_vis(t_canvas *x, t_floatarg f) {
+ int hadwindow = x->havewindow;
/* if window contents have never been subscribed it should subscribe them here but it doesn't */
SET(havewindow,!!f);
+ if (!hadwindow && x->havewindow) canvas_map(x,1);
+ if (hadwindow && !x->havewindow) canvas_map(x,0);
}
***************
*** 769,772 ****
--- 783,787 ----
static void canvas_push(t_canvas *x) {pd_pushsym(x);}
+ /* assuming that this only ever gets called on toplevel canvases (?) */
static void canvas_pop(t_canvas *x, t_floatarg fvis) {
pd_popsym(x);
***************
*** 774,783 ****
canvas_resortinlets(x);
canvas_resortoutlets(x);
! if (fvis) {
! canvas_vis(x, 1);
! gobj_subscribe(x,manager);
! // gobj_changed(x,0);
! canvas_redraw(x);
! }
}
--- 789,801 ----
canvas_resortinlets(x);
canvas_resortoutlets(x);
! if (fvis) canvas_vis(x, 1);
! }
! /* called by m_class.c */
! extern "C" void canvas_popabstraction(t_canvas *x) {
! pd_set_newest(x);
! pd_popsym(x);
! x->loading = 0;
! canvas_resortinlets(x);
! canvas_resortoutlets(x);
}
***************
*** 849,861 ****
void pd_set_newest (t_pd *x) {newest = x;}
- /* called by m_class.c */
- extern "C" void canvas_popabstraction(t_canvas *x) {
- pd_set_newest(x);
- pd_popsym(x);
- x->loading = 0;
- canvas_resortinlets(x);
- canvas_resortoutlets(x);
- }
-
static void *subcanvas_new(t_symbol *s) {
t_atom a[6];
--- 867,870 ----
***************
*** 5721,5726 ****
static t_class *gatom_class;
- void pd_upload(t_gobj *self);
-
void canvas_text(t_canvas *gl, t_symbol *s, int argc, t_atom *argv) {
t_text *x = (t_text *)pd_new(text_class);
--- 5730,5733 ----
More information about the Pd-cvs
mailing list