[PD-cvs] pd/src desire.c,1.1.2.108,1.1.2.109

Mathieu Bouchard matju at users.sourceforge.net
Sun Aug 20 08:04:54 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.c 
Log Message:
.


Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.108
retrieving revision 1.1.2.109
diff -C2 -d -r1.1.2.108 -r1.1.2.109
*** desire.c	20 Aug 2006 05:21:36 -0000	1.1.2.108
--- desire.c	20 Aug 2006 06:04:52 -0000	1.1.2.109
***************
*** 589,594 ****
      glist_init(x);
      x->gl_obj.te_type = T_OBJECT;
!     if (!*sym->s_name)
!     {
          char buf[40];
          sprintf(buf, "graph%d", ++gcount);
--- 589,593 ----
      glist_init(x);
      x->gl_obj.te_type = T_OBJECT;
!     if (!*sym->s_name) {
          char buf[40];
          sprintf(buf, "graph%d", ++gcount);
***************
*** 607,626 ****
          zz       = py2; py2 = py1; py1 = zz;
      }
!     if (x1 == x2 || y1 == y2)
!         x1 = 0, x2 = 100, y1 = 1, y2 = -1;
!     if (px1 >= px2 || py1 >= py2)
!         px1 = 100, py1 = 20, px2 = 100 + GLIST_DEFGRAPHWIDTH,
!             py2 = 20 + GLIST_DEFGRAPHHEIGHT;
      x->gl_name = sym;
!     x->gl_x1 = x1;
!     x->gl_x2 = x2;
!     x->gl_y1 = y1;
!     x->gl_y2 = y2;
!     x->gl_obj.te_xpix = px1;
!     x->gl_obj.te_ypix = py1;
!     x->gl_pixwidth = px2 - px1;
!     x->gl_pixheight = py2 - py1;
!     x->gl_font =  (canvas_getcurrent() ?
!         canvas_getcurrent()->gl_font : sys_defaultfont);
      x->gl_screenx1 = x->gl_screeny1 = 0;
      x->gl_screenx2 = 450;
--- 606,617 ----
          zz       = py2; py2 = py1; py1 = zz;
      }
!     if (x1 == x2 || y1 == y2) {x1=0; x2=100; y1=1; y2=-1;}
!     if (px1 >= px2 || py1 >= py2) {
! 	px1=100; py1=20; px2=100+GLIST_DEFGRAPHWIDTH; py2=20+GLIST_DEFGRAPHHEIGHT;
!     }
      x->gl_name = sym;
!     x->gl_x1 = x1; x->gl_y1 = y1; x->gl_obj.te_xpix = px1; x->gl_pixwidth  = px2-px1;
!     x->gl_x2 = x2; x->gl_y2 = y2; x->gl_obj.te_ypix = py1; x->gl_pixheight = py2-py1;
!     x->gl_font =  (canvas_getcurrent() ? canvas_getcurrent()->gl_font : sys_defaultfont);
      x->gl_screenx1 = x->gl_screeny1 = 0;
      x->gl_screenx2 = 450;
***************
*** 633,641 ****
      x->gl_obj.te_binbuf = binbuf_new();
      binbuf_addv(x->gl_obj.te_binbuf, "s", gensym("graph"));
!     if (!menu)
!         pd_pushsym(&x->gl_pd);
      glist_add(g, &x->gl_gobj);
!     if (glist_isvisible(g))
!         canvas_create_editor(x, 1);
      return (x);
  }
--- 624,630 ----
      x->gl_obj.te_binbuf = binbuf_new();
      binbuf_addv(x->gl_obj.te_binbuf, "s", gensym("graph"));
!     if (!menu) pd_pushsym(&x->gl_pd);
      glist_add(g, &x->gl_gobj);
!     if (glist_isvisible(g)) canvas_create_editor(x, 1);
      return (x);
  }
***************
*** 644,648 ****
  void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv)
  {
!     t_symbol *sym;   
      float x1,y1,x2,y2,px1,py1,px2,py2;
      pd_scanargs(argc,argv,"sffffffff",&sym,&x1,&y1,&x2,&y2,&px1,&py1,&px2,&py2);
--- 633,637 ----
  void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv)
  {
!     t_symbol *sym;
      float x1,y1,x2,y2,px1,py1,px2,py2;
      pd_scanargs(argc,argv,"sffffffff",&sym,&x1,&y1,&x2,&y2,&px1,&py1,&px2,&py2);
***************
*** 662,666 ****
  {
      int heightwas = y2 - y1;
!     int heightchange = y2 - y1 - (x->gl_screeny2 - x->gl_screeny1);    
      if (x->gl_screenx1 == x1 && x->gl_screeny1 == y1 &&
          x->gl_screenx2 == x2 && x->gl_screeny2 == y2)
--- 651,655 ----
  {
      int heightwas = y2 - y1;
!     int heightchange = y2 - y1 - (x->gl_screeny2 - x->gl_screeny1);
      if (x->gl_screenx1 == x1 && x->gl_screeny1 == y1 &&
          x->gl_screenx2 == x2 && x->gl_screeny2 == y2)
***************
*** 3267,3272 ****
          while (inno >= obj_ninlets(objsink))
              inlet_new(objsink, &objsink->ob_pd, &s_, &s_);
!     post ("%d %d %d %d", whoout2, outno, whoin2, inno);
!     post("canvas_connect: objsrc=%d outno=%d objsink=%d inno=%d",objsrc,outno,objsink,inno);
      // shouldn't use sys_mgui because it interferes with the queue
      // sys_mgui((t_canvas *)x,"wires_new","iiii", whoout2, outno, whoin2, inno);
--- 3256,3261 ----
          while (inno >= obj_ninlets(objsink))
              inlet_new(objsink, &objsink->ob_pd, &s_, &s_);
!     /*post ("%d %d %d %d", whoout2, outno, whoin2, inno);
!     post("canvas_connect: objsrc=%d outno=%d objsink=%d inno=%d",objsrc,outno,objsink,inno);*/
      // shouldn't use sys_mgui because it interferes with the queue
      // sys_mgui((t_canvas *)x,"wires_new","iiii", whoout2, outno, whoin2, inno);
***************
*** 4946,4962 ****
  void glist_add(t_glist *x, t_gobj *y)
  {
!     char *buf; int bufn;
      if (!y->g_pd->c_patchable) {
  	printf("glist_add %p %p class=%s (non-t_text)\n",x,y,y->g_pd->c_name->s_name);
      } else {
  	t_binbuf *bb = ((t_text *)y)->te_binbuf;
  	if (bb->b_vec) {
  	    binbuf_gettext(bb,&buf,&bufn);
  	    printf("glist_add %p %p [%.*s]\n",x,y,bufn,buf);
  	} else {
  	    printf("glist_add %p %p class=%s (binbuf without b_vec !)\n",x,y,y->g_pd->c_name->s_name);
  	}
      }
!     free(buf);
      gobj_subscribe(y,(t_gobj *)x);
  
--- 4935,4953 ----
  void glist_add(t_glist *x, t_gobj *y)
  {
! /*
      if (!y->g_pd->c_patchable) {
  	printf("glist_add %p %p class=%s (non-t_text)\n",x,y,y->g_pd->c_name->s_name);
      } else {
+         char *buf; int bufn;
  	t_binbuf *bb = ((t_text *)y)->te_binbuf;
  	if (bb->b_vec) {
  	    binbuf_gettext(bb,&buf,&bufn);
  	    printf("glist_add %p %p [%.*s]\n",x,y,bufn,buf);
+ 	    free(buf);
  	} else {
  	    printf("glist_add %p %p class=%s (binbuf without b_vec !)\n",x,y,y->g_pd->c_name->s_name);
  	}
      }
! */
      gobj_subscribe(y,(t_gobj *)x);
  
***************
*** 4964,4975 ****
      /* gobj_changed(y,0); */
      /* don't delay first uploading of object (DesireData >= 2006.08.19) */
!     pd_upload(y);
  
      y->g_next = 0;
!     if (!x->gl_list) x->gl_list = y;
!     else
!     {
          t_gobj *y2;
!         for (y2 = x->gl_list; y2->g_next; y2 = y2->g_next);
          y2->g_next = y;
      }
--- 4955,4966 ----
      /* gobj_changed(y,0); */
      /* don't delay first uploading of object (DesireData >= 2006.08.19) */
!     /* pd_upload(y); */
!     /* if (glist_isvisible(x)) gobj_vis(y,x,1); */
!     if (glist_isvisible(x)) pd_upload(y);
  
      y->g_next = 0;
!     if (!x->gl_list) x->gl_list = y; else {
          t_gobj *y2;
!         for (y2 = x->gl_list; y2->g_next; y2 = y2->g_next) {}
          y2->g_next = y;
      }
***************
*** 4977,4988 ****
      /* voodoo */
      /* if (x->gl_editor && (ob = pd_checkobject(&y->g_pd))) rtext_new(x, ob); */
!     if (x->gl_editor && x->gl_isgraph && !x->gl_goprect
!         && pd_checkobject(&y->g_pd))
!     {
          x->gl_goprect = 1;
          canvas_drawredrect(x, 1);
      }
!     if (glist_isvisible(x)) gobj_vis(y,x,1);
!     if (class_isdrawcommand(y->g_pd)) 
          canvas_redrawallfortemplate(template_findbyname(canvas_makebindsym(
              glist_getcanvas(x)->gl_name)), 0);
--- 4968,4976 ----
      /* voodoo */
      /* if (x->gl_editor && (ob = pd_checkobject(&y->g_pd))) rtext_new(x, ob); */
!     if (x->gl_editor && x->gl_isgraph && !x->gl_goprect && pd_checkobject(&y->g_pd)) {
          x->gl_goprect = 1;
          canvas_drawredrect(x, 1);
      }
!     if (class_isdrawcommand(y->g_pd))
          canvas_redrawallfortemplate(template_findbyname(canvas_makebindsym(
              glist_getcanvas(x)->gl_name)), 0);
***************
*** 5041,5046 ****
              glist_getcanvas(x)->gl_name)), 2);
      gobj_delete(y, x);
!     if (glist_isvisible(canvas))
!         gobj_vis(y, x, 0);
      if (x->gl_editor && (ob = pd_checkobject(&y->g_pd)))
          rtext_new(x, ob);
--- 5029,5038 ----
              glist_getcanvas(x)->gl_name)), 2);
      gobj_delete(y, x);
!     /*if (glist_isvisible(canvas)) gobj_vis(y,x,0);*/
!     if (glist_isvisible(canvas)) {
! 	/*!@#$ race condition because the queue might still contain something */
! 	sys_mgui(y,"_delete");
!     }
! 
      if (x->gl_editor && (ob = pd_checkobject(&y->g_pd)))
          rtext_new(x, ob);
***************
*** 6524,6529 ****
      t_outconnect *oc;
      canvas_savecontainerto(x,b);
!     for (y = x->gl_list; y; y = y->g_next)
!         gobj_save(y, b);
  
      linetraverser_start(&t, x);
--- 6516,6520 ----
      t_outconnect *oc;
      canvas_savecontainerto(x,b);
!     glist_each(y,x) gobj_save(y, b);
  
      linetraverser_start(&t, x);
***************
*** 6663,6669 ****
  {
      t_canvas *x2 = canvas_getrootfor(x);
!     post("canvas_save_as: old name: %s\n",x2->gl_name->s_name);
      x2->gl_name = name;
!     post("canvas_save_as: new name: %s\n",x2->gl_name->s_name);
      canvas_savetofile(x2, x2->gl_name, canvas_getdir(x2));
  }
--- 6654,6660 ----
  {
      t_canvas *x2 = canvas_getrootfor(x);
!     /* post("canvas_save_as: old name: %s\n",x2->gl_name->s_name); */
      x2->gl_name = name;
!     /* post("canvas_save_as: new name: %s\n",x2->gl_name->s_name); */
      canvas_savetofile(x2, x2->gl_name, canvas_getdir(x2));
  }





More information about the Pd-cvs mailing list