[PD-cvs] pd/src desire.c, 1.1.2.217.2.206, 1.1.2.217.2.207 desire.h, 1.1.2.49.2.41, 1.1.2.49.2.42

Mathieu Bouchard matju at users.sourceforge.net
Mon Aug 13 03:58:37 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7558

Modified Files:
      Tag: desiredata
	desire.c desire.h 
Log Message:
canvas: remove "mapped"


Index: desire.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v
retrieving revision 1.1.2.49.2.41
retrieving revision 1.1.2.49.2.42
diff -C2 -d -r1.1.2.49.2.41 -r1.1.2.49.2.42
*** desire.h	13 Aug 2007 01:51:39 -0000	1.1.2.49.2.41
--- desire.h	13 Aug 2007 01:58:35 -0000	1.1.2.49.2.42
***************
*** 166,170 ****
      t_canvasenvironment *env;  /* for root canvases and abstractions only */
      unsigned int havewindow:1; /* true if we own a window */
-     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 */
--- 166,169 ----

Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.206
retrieving revision 1.1.2.217.2.207
diff -C2 -d -r1.1.2.217.2.206 -r1.1.2.217.2.207
*** desire.c	13 Aug 2007 01:51:36 -0000	1.1.2.217.2.206
--- desire.c	13 Aug 2007 01:58:33 -0000	1.1.2.217.2.207
***************
*** 644,661 ****
  static void canvas_vis(t_canvas *x, t_floatarg f);
  
! /* canvas_map(,1)   subscribes the client upon canvas_vis(,1) and unminimizing.
!    canvas_map(,0) unsubscribes the client upon canvas_vis(,0) and   minimizing. */
! void canvas_map(t_canvas *x, bool f) {
!     if (f && !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);
  		gobj_changed(y,0); // could be made implicit
  	}
  	canvas_wires_each(oc,t,x) gobj_changed(oc,0); // this too
-     }
-     if (f==0 && canvas_isvisible(x)) gobj_unsubscribe(x,manager);
-     x->mapped = f;
  }
  
--- 644,655 ----
  static void canvas_vis(t_canvas *x, t_floatarg f);
  
! void canvas_map(t_canvas *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);
  		gobj_changed(y,0); // could be made implicit
  	}
  	canvas_wires_each(oc,t,x) gobj_changed(oc,0); // this too
  }
  
***************
*** 664,669 ****
      /* 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);
  }
  
--- 658,663 ----
      /* 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);
!     if (hadwindow && !x->havewindow) gobj_unsubscribe(x,manager);
  }
  
***************
*** 676,680 ****
  }
  
! int canvas_isvisible(t_canvas *x) {return !x->loading && canvas_getcanvas(x)->mapped;}
  
  /* we consider a graph "toplevel" if it has its own window or if it appears as a box in its parent window
--- 670,674 ----
  }
  
! int canvas_isvisible(t_canvas *x) {return !x->loading && canvas_getcanvas(x)->havewindow;}
  
  /* we consider a graph "toplevel" if it has its own window or if it appears as a box in its parent window
***************
*** 2432,2436 ****
  static int canvas_readscalar(t_canvas *x, int natoms, t_atom *vec, int *p_nextmsg, int selectit) {
      int nextmsg = *p_nextmsg;
!     int wasvis = canvas_isvisible(x);
      if (nextmsg >= natoms || vec[nextmsg].a_type != A_SYMBOL) {
          if (nextmsg < natoms) post("stopping early: type %d", vec[nextmsg].a_type);
--- 2426,2430 ----
  static int canvas_readscalar(t_canvas *x, int natoms, t_atom *vec, int *p_nextmsg, int selectit) {
      int nextmsg = *p_nextmsg;
!     //int wasvis = canvas_isvisible(x);
      if (nextmsg >= natoms || vec[nextmsg].a_type != A_SYMBOL) {
          if (nextmsg < natoms) post("stopping early: type %d", vec[nextmsg].a_type);
***************
*** 2443,2452 ****
      t_scalar *sc = scalar_new(x, ts);
      if (!sc) {error("couldn't create scalar \"%s\"", ts->name);    *p_nextmsg = natoms; return 0;}
!     if (wasvis) canvas_getcanvas(x)->mapped = 0;
      canvas_add(x,sc);
      int message;
      int nline = canvas_scanbinbuf(natoms, vec, &message, p_nextmsg);
      canvas_readatoms(x, natoms, vec, p_nextmsg, ts, sc->v, nline, vec + message);
!     if (wasvis) canvas_getcanvas(x)->mapped = 1;
      gobj_changed(sc,0);//is this necessary?
      return 1;
--- 2437,2446 ----
      t_scalar *sc = scalar_new(x, ts);
      if (!sc) {error("couldn't create scalar \"%s\"", ts->name);    *p_nextmsg = natoms; return 0;}
!     //if (wasvis) canvas_getcanvas(x)->mapped = 0;
      canvas_add(x,sc);
      int message;
      int nline = canvas_scanbinbuf(natoms, vec, &message, p_nextmsg);
      canvas_readatoms(x, natoms, vec, p_nextmsg, ts, sc->v, nline, vec + message);
!     //if (wasvis) canvas_getcanvas(x)->mapped = 1;
      gobj_changed(sc,0);//is this necessary?
      return 1;
***************
*** 2729,2733 ****
      binbuf_addv(b,"ttiiii","#N","canvas",x1,y1,xs,ys);
      if (x->owner && !x->env) { /* subpatch */
! 	binbuf_addv(b, "si;", (patchsym != &s_ ? patchsym: gensym("(subpatch)")), x->mapped);
      } else { /* root or abstraction */
          binbuf_addv(b, "i;", (int)x->font);
--- 2723,2727 ----
      binbuf_addv(b,"ttiiii","#N","canvas",x1,y1,xs,ys);
      if (x->owner && !x->env) { /* subpatch */
! 	binbuf_addv(b, "si;", (patchsym != &s_ ? patchsym: gensym("(subpatch)")), x->havewindow);
      } else { /* root or abstraction */
          binbuf_addv(b, "i;", (int)x->font);





More information about the Pd-cvs mailing list