[PD-cvs] pd/src desire.c,1.1.2.178,1.1.2.179

Mathieu Bouchard matju at users.sourceforge.net
Fri Sep 15 09:39:11 CEST 2006


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

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.178
retrieving revision 1.1.2.179
diff -C2 -d -r1.1.2.178 -r1.1.2.179
*** desire.c	11 Sep 2006 08:18:36 -0000	1.1.2.178
--- desire.c	15 Sep 2006 07:39:07 -0000	1.1.2.179
***************
*** 406,410 ****
  static void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir) {
      t_symbol *bs = canvas_makebindsym(x->name);
-     t_symbol *Pd = gensym("Pd");
      if (x->name!=Pd) pd_unbind((t_pd *)x, bs);
      x->name = s;
--- 406,409 ----
***************
*** 544,549 ****
      else {
          canvas_setgraph(x, atom_getintarg(6, argc, argv), 0);
!         x->xmargin =    atom_getintarg(7, argc, argv);
!         x->ymargin =    atom_getintarg(8, argc, argv);
      }
  }
--- 543,548 ----
      else {
          canvas_setgraph(x, atom_getintarg(6, argc, argv), 0);
!         x->xmargin =       atom_getintarg(7, argc, argv);
!         x->ymargin =       atom_getintarg(8, argc, argv);
      }
  }
***************
*** 4212,4221 ****
      for (i = 0; i < scalartemplate->n; i++) {
          t_dataslot *ds = scalartemplate->vec + i;
!         if (ds->type == DT_LIST) {
!             t_canvas *gl2 = x->sc_vec[i].w_list;
!             template_conformcanvas(tfrom, tto, gl2, conformaction);
!         } else if (ds->type == DT_ARRAY) {
!             template_conformarray(tfrom, tto, conformaction, x->sc_vec[i].w_array);
!         }
      }
      return x;
--- 4211,4216 ----
      for (i = 0; i < scalartemplate->n; i++) {
          t_dataslot *ds = scalartemplate->vec + i;
!         if (ds->type == DT_LIST) template_conformcanvas(tfrom, tto, x->sc_vec[i].w_list, conformaction);
!         if (ds->type == DT_ARRAY) template_conformarray(tfrom, tto, conformaction, x->sc_vec[i].w_array);
      }
      return x;
***************
*** 4228,4233 ****
      if (a->templatesym == tfrom->sym) {
          /* the array elements must all be conformed */
!         int oldelemsize = sizeof(t_word) * tfrom->n,
!             newelemsize = sizeof(t_word) *   tto->n;
          char *newarray = (char *)getbytes(newelemsize * a->n);
          char *oldarray = a->vec;
--- 4223,4228 ----
      if (a->templatesym == tfrom->sym) {
          /* the array elements must all be conformed */
!         int oldelemsize = sizeof(t_word) * tfrom->n;
! 	int newelemsize = sizeof(t_word) *   tto->n;
          char *newarray = (char *)getbytes(newelemsize * a->n);
          char *oldarray = a->vec;
***************
*** 4242,4258 ****
          a->vec = newarray;
          freebytes(oldarray, oldelemsize * a->n);
!     }
!     else scalartemplate = template_findbyname(a->templatesym);
!         /* convert all arrays and sublist fields in each element of the array */
      for (i = 0; i < a->n; i++) {
          t_word *wp = (t_word *)(a->vec + sizeof(t_word) * a->n * i);
          for (j = 0; j < scalartemplate->n; j++) {
              t_dataslot *ds = scalartemplate->vec + j;
!             if (ds->type == DT_LIST) {
!                 t_canvas *gl2 = wp[j].w_list;
!                 template_conformcanvas(tfrom, tto, gl2, conformaction);
!             } else if (ds->type == DT_ARRAY) {
!                 template_conformarray(tfrom, tto, conformaction, wp[j].w_array);
!             }
          }
      }
--- 4237,4248 ----
          a->vec = newarray;
          freebytes(oldarray, oldelemsize * a->n);
!     } else scalartemplate = template_findbyname(a->templatesym);
!     /* convert all arrays and sublist fields in each element of the array */
      for (i = 0; i < a->n; i++) {
          t_word *wp = (t_word *)(a->vec + sizeof(t_word) * a->n * i);
          for (j = 0; j < scalartemplate->n; j++) {
              t_dataslot *ds = scalartemplate->vec + j;
!             if (ds->type == DT_LIST)  template_conformcanvas(tfrom, tto, wp[j].w_list, conformaction);
!             if (ds->type == DT_ARRAY) template_conformarray(tfrom, tto, conformaction, wp[j].w_array);
          }
      }
***************
*** 4262,4278 ****
     to the "from" template and makes it belong to the "to" template.  Descend canvases recursively.
     We don't handle redrawing here; this is to be filled in LATER... */
- 
  t_array *garray_getarray(t_garray *x);
  static void template_conformcanvas(t_template *tfrom, t_template *tto, t_canvas *canvas, int *conformaction) {
      t_gobj *g;
-     /* post("conform canvas %s", canvas->name->s_name); */
      canvas_each(g,canvas) {
!         if (pd_class(&g->g_pd) == scalar_class)
!             g = &template_conformscalar(tfrom, tto, conformaction, canvas, (t_scalar *)g)->sc_gobj;
!         else if (pd_class(&g->g_pd) == canvas_class)
              template_conformcanvas(tfrom, tto, (t_canvas *)g, conformaction);
!         else if (pd_class(&g->g_pd) == garray_class)
!             template_conformarray(tfrom, tto, conformaction,
!                 garray_getarray((t_garray *)g));
      }
  }
--- 4252,4266 ----
     to the "from" template and makes it belong to the "to" template.  Descend canvases recursively.
     We don't handle redrawing here; this is to be filled in LATER... */
  t_array *garray_getarray(t_garray *x);
  static void template_conformcanvas(t_template *tfrom, t_template *tto, t_canvas *canvas, int *conformaction) {
      t_gobj *g;
      canvas_each(g,canvas) {
! 	t_class *c = pd_class(&g->g_pd);
!         if (c==scalar_class)
!             g = (t_gobj *)template_conformscalar(tfrom, tto, conformaction, canvas, (t_scalar *)g);
!         else if (c==canvas_class)
              template_conformcanvas(tfrom, tto, (t_canvas *)g, conformaction);
!         else if (c==garray_class)
!             template_conformarray(tfrom, tto, conformaction, garray_getarray((t_garray *)g));
      }
  }
***************
*** 4439,4443 ****
  }
  
!     /* old version (0.34) -- delete 2003 or so */
  static void *gtemplate_new_old(t_symbol *s, int argc, t_atom *argv) {
      t_symbol *sym = canvas_makebindsym(canvas_getcurrent()->name);
--- 4427,4431 ----
  }
  
! /* old version (0.34) -- delete 2003 or so */
  static void *gtemplate_new_old(t_symbol *s, int argc, t_atom *argv) {
      t_symbol *sym = canvas_makebindsym(canvas_getcurrent()->name);
***************
*** 4471,4480 ****
      } else {
          t_gtemplate *x2, *x3;
!         for (x2 = t->t_list; (x3 = x2->x_next); x2 = x3) {
!             if (x == x3) {
!                 x2->x_next = x3->x_next;
!                 break;
!             }
!         }
      }
      freebytes(x->argv, sizeof(t_atom) * x->argc);
--- 4459,4463 ----
      } else {
          t_gtemplate *x2, *x3;
!         for (x2=t->t_list; (x3=x2->x_next); x2=x3) if (x==x3) {x2->x_next=x3->x_next; break;}
      }
      freebytes(x->argv, sizeof(t_atom) * x->argc);
***************
*** 4636,4643 ****
      t_object o;
      int flags; /* CLOSED and/or BEZ */
!     t_slot fillcolor;
!     t_slot outlinecolor;
!     t_slot width;
!     t_slot vis;
      int npoints;
      t_slot *vec;
--- 4619,4623 ----
      t_object o;
      int flags; /* CLOSED and/or BEZ */
!     t_slot fillcolor, outlinecolor, width, vis;
      int npoints;
      t_slot *vec;
***************
*** 4666,4673 ****
          } else break;
      }
- 
      if (flags&CLOSED&&argc) slot_setfloatarg(   &x->fillcolor, argc--,argv++);
      else                    slot_setfloat_const(&x->fillcolor, 0);
- 
      FIELDSET(float,outlinecolor,0);
      FIELDSET(float,width,1);
--- 4646,4651 ----
***************
*** 4687,4692 ****
          return;
      }
!     viswas = (x->vis.u.f != 0);
!     if ((f != 0 && viswas) || (f == 0 && !viswas)) return;
      canvas_redrawallfortemplatecanvas(x->canvas, 2);
      slot_setfloat_const(&x->vis, f!=0);
--- 4665,4670 ----
          return;
      }
!     viswas = x->vis.u.f!=0;
!     if ((f!=0 && viswas) || (f==0 && !viswas)) return;
      canvas_redrawallfortemplatecanvas(x->canvas, 2);
      slot_setfloat_const(&x->vis, f!=0);
***************
*** 4694,4699 ****
  }
  
- /* -------------------- widget behavior for curve ------------ */
- 
  static void curve_getrect(t_gobj *z, t_canvas *canvas, t_word *data, t_template *template,
  float basex, float basey, int *xp1, int *yp1, int *xp2, int *yp2) {
--- 4672,4675 ----
***************
*** 4789,4792 ****
--- 4765,4770 ----
  #endif
  
+ int iabs(int a) {return a<0?-a:a;}
+ 
  static int curve_click(t_gobj *z, t_canvas *canvas, t_word *data, t_template *template, t_scalar *sc,
  t_array *ap, float basex, float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) {
***************
*** 4800,4807 ****
          int xval = slot_getcoord(f  , template, data, 0), xloc = canvas_xtopixels(canvas, basex + xval);
          int yval = slot_getcoord(f+1, template, data, 0), yloc = canvas_ytopixels(canvas, basey + yval);
!         int xerr = xloc - xpix, yerr = yloc - ypix;
          if (!f->var && !(f+1)->var) continue;
-         if (xerr < 0) xerr = -xerr;
-         if (yerr < 0) yerr = -yerr;
          if (yerr > xerr) xerr = yerr;
          if (xerr < besterror) {
--- 4778,4784 ----
          int xval = slot_getcoord(f  , template, data, 0), xloc = canvas_xtopixels(canvas, basex + xval);
          int yval = slot_getcoord(f+1, template, data, 0), yloc = canvas_ytopixels(canvas, basey + yval);
!         int xerr = iabs(xloc-xpix);
! 	int yerr = iabs(yloc-ypix);
          if (!f->var && !(f+1)->var) continue;
          if (yerr > xerr) xerr = yerr;
          if (xerr < besterror) {
***************
*** 4816,4821 ****
          cm.xper = canvas_pixelstox(canvas, 1) - canvas_pixelstox(canvas, 0);
          cm.yper = canvas_pixelstoy(canvas, 1) - canvas_pixelstoy(canvas, 0);
!         cm.xcumulative = 0;
!         cm.ycumulative = 0;
          cm.canvas = canvas;
          cm.scalar = sc;
--- 4793,4797 ----
          cm.xper = canvas_pixelstox(canvas, 1) - canvas_pixelstox(canvas, 0);
          cm.yper = canvas_pixelstoy(canvas, 1) - canvas_pixelstoy(canvas, 0);
!         cm.xcumulative = cm.ycumulative = 0;
          cm.canvas = canvas;
          cm.scalar = sc;
***************
*** 4843,4847 ****
      t_slot data, xpoints, ypoints, wpoints;
      t_slot vis;
!     t_slot scalarvis;    /* true if drawing the scalar at each point */
  } t_plot;
  
--- 4819,4823 ----
      t_slot data, xpoints, ypoints, wpoints;
      t_slot vis;
!     t_slot scalarvis; /* true if drawing the scalar at each point */
  } t_plot;
  
***************
*** 4858,4865 ****
          t_symbol *firstarg = atom_getsymbolarg(0, argc, argv);
  	const char *f = firstarg->s_name;
!         if (!strcmp(f, "curve") || !strcmp(f, "-c")) {
!             defstyle = PLOTSTYLE_BEZ;
!             argc--, argv++;
!         }
          else if (!strcmp(f,"-v") &&argc>1) {slot_setfloatarg(&x->vis,      1,argv+1);argc-=2;argv+=2;}
          else if (!strcmp(f,"-vs")&&argc>1) {slot_setfloatarg(&x->scalarvis,1,argv+1);argc-=2;argv+=2;}
--- 4834,4838 ----
          t_symbol *firstarg = atom_getsymbolarg(0, argc, argv);
  	const char *f = firstarg->s_name;
!         if (!strcmp(f, "curve") || !strcmp(f, "-c")) {defstyle = PLOTSTYLE_BEZ;      argc--; argv++; }
          else if (!strcmp(f,"-v") &&argc>1) {slot_setfloatarg(&x->vis,      1,argv+1);argc-=2;argv+=2;}
          else if (!strcmp(f,"-vs")&&argc>1) {slot_setfloatarg(&x->scalarvis,1,argv+1);argc-=2;argv+=2;}
***************
*** 4885,4890 ****
          return;
      }
!     viswas = x->vis.u.f != 0;
!     if ((f != 0 && viswas) || (f == 0 && !viswas)) return;
      canvas_redrawallfortemplatecanvas(x->canvas, 2);
      slot_setfloat_const(&x->vis, f!=0);
--- 4858,4863 ----
          return;
      }
!     viswas = x->vis.u.f!=0;
!     if ((f!=0 && viswas) || (f==0 && !viswas)) return;
      canvas_redrawallfortemplatecanvas(x->canvas, 2);
      slot_setfloat_const(&x->vis, f!=0);
***************
*** 4892,4907 ****
  }
  
- /* -------------------- widget behavior for plot ------------ */
- 
  /* get everything we'll need from the owner template of the array being
     plotted. Not used for garrays, but see below */
  static int plot_readownertemplate(t_plot *x, t_word *data, t_template *ownertemplate,
  t_symbol **elemtemplatesymp, t_array **arrayp, float *linewidthp, float *xlocp, float *xincp, float *ylocp,
! float *stylep, float *visp, float *scalarvisp, t_slot **xfield, t_slot **yfield, t_slot **wfield) {
      int arrayonset, type;
      t_symbol *elemtemplatesym;
      t_array *array;
- 
-     /* find the data and verify it's an array */
      if (x->data.type != A_ARRAY || !x->data.var) {
          pd_error(x,"needs an array field");
--- 4865,4876 ----
  }
  
  /* get everything we'll need from the owner template of the array being
     plotted. Not used for garrays, but see below */
  static int plot_readownertemplate(t_plot *x, t_word *data, t_template *ownertemplate,
  t_symbol **elemtemplatesymp, t_array **arrayp, float *linewidthp, float *xlocp, float *xincp, float *ylocp,
! float *stylep, float *visp, float *scalarvisp) {
      int arrayonset, type;
      t_symbol *elemtemplatesym;
      t_array *array;
      if (x->data.type != A_ARRAY || !x->data.var) {
          pd_error(x,"needs an array field");
***************
*** 4926,4932 ****
      *elemtemplatesymp = elemtemplatesym;
      *arrayp = array;
-     *xfield = &x->xpoints;
-     *yfield = &x->ypoints;
-     *wfield = &x->wpoints;
      return 0;
  }
--- 4895,4898 ----
***************
*** 4941,4945 ****
      t_symbol *dummy, *varname;
      t_canvas *elemtemplatecanvas = 0;
- 
      /* the "float" template is special in not having to have a canvas;
         template_findbyname is hardwired to return a predefined template. */
--- 4907,4910 ----
***************
*** 4955,4959 ****
      *elemtemplatep = elemtemplate;
      *elemsizep = elemtemplate->n * sizeof(t_word);
- 
  #define FOO(f,name,onset) \
    varname = f && f->var ? f->u.varsym : gensym(name); \
--- 4920,4923 ----
***************
*** 4980,4984 ****
      t_slot *xslot, *yslot, *wslot;
      if (plot_readownertemplate(x, data, template, &elemtemplatesym, &array, &linewidth, &xloc,
! 	&xinc, &yloc, &style, &vis, &scalarvis, &xslot, &yslot, &wslot)) goto end;
      if (!vis) goto end;
      if (array_getfields(elemtemplatesym, &elemtemplatecanvas,
--- 4944,4952 ----
      t_slot *xslot, *yslot, *wslot;
      if (plot_readownertemplate(x, data, template, &elemtemplatesym, &array, &linewidth, &xloc,
! 	&xinc, &yloc, &style, &vis, &scalarvis)) goto end;
!     xslot = &x->xpoints;
!     yslot = &x->ypoints;
!     wslot = &x->wpoints;
! 
      if (!vis) goto end;
      if (array_getfields(elemtemplatesym, &elemtemplatecanvas,
***************
*** 5032,5036 ****
      t_slot *xslot, *yslot, *wslot;
      if (plot_readownertemplate(x, data, template, &elemtemplatesym, &array, &linewidth, &xloc, &xinc,
! 	&yloc, &style, &vis, &scalarvis, &xslot, &yslot, &wslot)) return;
      if (!vis) return;
      if (array_getfields(elemtemplatesym, &elemtemplatecanvas, &elemtemplate, &elemsize,
--- 5000,5007 ----
      t_slot *xslot, *yslot, *wslot;
      if (plot_readownertemplate(x, data, template, &elemtemplatesym, &array, &linewidth, &xloc, &xinc,
! 	&yloc, &style, &vis, &scalarvis)) return;
!     xslot = &x->xpoints;
!     yslot = &x->ypoints;
!     wslot = &x->wpoints;
      if (!vis) return;
      if (array_getfields(elemtemplatesym, &elemtemplatecanvas, &elemtemplate, &elemsize,
***************
*** 5080,5092 ****
                  sys_vgui(".x%lx.c create polygon \\\n", (long)canvas_getcanvas(canvas));
                  for (i = 0, xsum = xloc; i < nelem; i++) {
!                     if (xonset >= 0) usexloc = xloc + *(float *)((elem + elemsize*i) + xonset);
  		    else usexloc = xsum, xsum += xinc;
!                     if (yonset >= 0) yval = *(float *)((elem + elemsize*i) + yonset); else yval = 0;
!                     wval = *(float *)((elem + elemsize*i) + wonset);
                      xpix = canvas_xtopixels(canvas, basex + slot_cvttocoord(xslot, usexloc));
                      ixpix = xpix + 0.5;
                      if (xonset >= 0 || ixpix != lastpixel) {
                          sys_vgui("%d %f \\\n", ixpix, canvas_ytopixels(canvas,
! 				basey + slot_cvttocoord(yslot, yloc + yval)
  				      - slot_cvttocoord(wslot,wval)));
                          ndrawn++;
--- 5051,5063 ----
                  sys_vgui(".x%lx.c create polygon \\\n", (long)canvas_getcanvas(canvas));
                  for (i = 0, xsum = xloc; i < nelem; i++) {
!                     if (xonset >= 0) usexloc = xloc + *(float *)(elem+elemsize*i+xonset);
  		    else usexloc = xsum, xsum += xinc;
!                     yval = yonset>=0 ? *(float *)(elem+elemsize*i+yonset) : 0;
!                     wval = *(float *)(elem+elemsize*i+wonset);
                      xpix = canvas_xtopixels(canvas, basex + slot_cvttocoord(xslot, usexloc));
                      ixpix = xpix + 0.5;
                      if (xonset >= 0 || ixpix != lastpixel) {
                          sys_vgui("%d %f \\\n", ixpix, canvas_ytopixels(canvas,
! 				basey + slot_cvttocoord(yslot,yval+yloc)
  				      - slot_cvttocoord(wslot,wval)));
                          ndrawn++;
***************
*** 5098,5104 ****
                  for (i = nelem-1; i >= 0; i--) {
                      float usexloc;
!                     if (xonset >= 0) usexloc = xloc + *(float *)((elem + elemsize*i) + xonset);
  		    else xsum -= xinc, usexloc = xsum;
!                     if (yonset >= 0) yval = *(float *)((elem + elemsize*i) + yonset); else yval = 0;
                      wval = *(float *)((elem + elemsize*i) + wonset);
                      xpix = canvas_xtopixels(canvas, basex + slot_cvttocoord(xslot, usexloc));
--- 5069,5075 ----
                  for (i = nelem-1; i >= 0; i--) {
                      float usexloc;
!                     if (xonset >= 0) usexloc = xloc + *(float *)(elem+elemsize*i+xonset);
  		    else xsum -= xinc, usexloc = xsum;
!                     if (yonset >= 0) yval = *(float *)(elem+elemsize*i+yonset); else yval = 0;
                      wval = *(float *)((elem + elemsize*i) + wonset);
                      xpix = canvas_xtopixels(canvas, basex + slot_cvttocoord(xslot, usexloc));
***************
*** 5106,5110 ****
                      if (xonset >= 0 || ixpix != lastpixel) {
                          sys_vgui("%d %f \\\n", ixpix, canvas_ytopixels(canvas,
!                             basey + yloc + slot_cvttocoord(yslot, yval) + slot_cvttocoord(wslot, wval)));
                          ndrawn++;
                      }
--- 5077,5081 ----
                      if (xonset >= 0 || ixpix != lastpixel) {
                          sys_vgui("%d %f \\\n", ixpix, canvas_ytopixels(canvas,
!                         	basey + yloc + slot_cvttocoord(yslot, yval) + slot_cvttocoord(wslot, wval)));
                          ndrawn++;
                      }
***************
*** 5130,5139 ****
                  for (xsum = xloc, i = 0; i < nelem; i++) {
                      float usexloc;
!                     if (xonset >= 0) usexloc = xloc + *(float *)((elem + elemsize*i) + xonset); else usexloc = xsum, xsum += xinc;
!                     if (yonset >= 0) yval = *(float *)((elem + elemsize*i) + yonset); else yval = 0;
                      xpix = canvas_xtopixels(canvas, basex + slot_cvttocoord(xslot, usexloc));
                      ixpix = xpix + 0.5;
                      if (xonset >= 0 || ixpix != lastpixel) {
!                         sys_vgui("%d %f \\\n", ixpix, canvas_ytopixels(canvas, basey + yloc + slot_cvttocoord(yslot, yval)));
                          ndrawn++;
                      }
--- 5101,5111 ----
                  for (xsum = xloc, i = 0; i < nelem; i++) {
                      float usexloc;
!                     if (xonset >= 0) usexloc = xloc + *(float *)(elem+elemsize*i+xonset); else usexloc = xsum, xsum += xinc;
!                     if (yonset >= 0) yval = *(float *)(elem+elemsize*i+yonset); else yval = 0;
                      xpix = canvas_xtopixels(canvas, basex + slot_cvttocoord(xslot, usexloc));
                      ixpix = xpix + 0.5;
                      if (xonset >= 0 || ixpix != lastpixel) {
!                         sys_vgui("%d %f \\\n", ixpix,
! 				canvas_ytopixels(canvas, basey + yloc + slot_cvttocoord(yslot, yval)));
                          ndrawn++;
                      }
***************
*** 5141,5145 ****
                      if (ndrawn >= 1000) break;
                  }
!                     /* TK will complain if there aren't at least 2 points... */
                  if (ndrawn == 0) sys_vgui("0 0 0 0 \\\n");
                  else if (ndrawn == 1) sys_vgui("%d %f \\\n", ixpix + 10,
--- 5113,5117 ----
                      if (ndrawn >= 1000) break;
                  }
!                 /* TK will complain if there aren't at least 2 points... */
                  if (ndrawn == 0) sys_vgui("0 0 0 0 \\\n");
                  else if (ndrawn == 1) sys_vgui("%d %f \\\n", ixpix + 10,
***************
*** 5159,5168 ****
                  t_gobj *y;
                  if (xonset >= 0)
!                     usexloc = basex + xloc + *(float *)((elem + elemsize*i) + xonset); else usexloc = basex + xsum, xsum += xinc;
!                 if (yonset >= 0) yval = *(float *)((elem + elemsize*i) + yonset); else yval = 0;
                  useyloc = basey + yloc + slot_cvttocoord(yslot, yval);
                  canvas_each(y,elemtemplatecanvas) {
                      t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                     if (wb) wb->w_parentvisfn(y, canvas, (t_word *)(elem + elemsize*i),
  			elemtemplate, usexloc, useyloc, tovis);
                  }
--- 5131,5140 ----
                  t_gobj *y;
                  if (xonset >= 0)
!                     usexloc = basex + xloc + *(float *)(elem+elemsize*i+xonset); else usexloc = basex + xsum, xsum += xinc;
!                 yval = yonset>=0 ? *(float *)(elem+elemsize*i+yonset) : 0;
                  useyloc = basey + yloc + slot_cvttocoord(yslot, yval);
                  canvas_each(y,elemtemplatecanvas) {
                      t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                     if (wb) wb->w_parentvisfn(y, canvas, (t_word *)(elem+elemsize*i),
  			elemtemplate, usexloc, useyloc, tovis);
                  }
***************
*** 5177,5181 ****
                  canvas_each(y,elemtemplatecanvas) {
                      t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                     if (wb) wb->w_parentvisfn(y, canvas, (t_word *)(elem + elemsize*i), elemtemplate,0,0,0);
                  }
              }
--- 5149,5153 ----
                  canvas_each(y,elemtemplatecanvas) {
                      t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                     if (wb) wb->w_parentvisfn(y, canvas, (t_word *)(elem+elemsize*i), elemtemplate,0,0,0);
                  }
              }
***************
*** 5192,5201 ****
      float linewidth, xloc, xinc, yloc, style, vis, scalarvis;
      t_array *array;
!     t_slot *xslot, *yslot, *wslot;
!     if (plot_readownertemplate(x, data, template, &elemtemplatesym, &array, &linewidth,
! 	&xloc, &xinc, &yloc, &style, &vis, &scalarvis, &xslot, &yslot, &wslot)) return 0;
      if (!vis) return 0;
      return array_doclick(array, canvas, sc, ap, elemtemplatesym, linewidth, basex + xloc, xinc,
! 	basey + yloc, scalarvis, xslot, yslot, wslot, xpix, ypix, shift, alt, dbl, doit);
  }
  
--- 5164,5172 ----
      float linewidth, xloc, xinc, yloc, style, vis, scalarvis;
      t_array *array;
!     if (plot_readownertemplate(x, data, template, &elemtemplatesym, &array, &linewidth, &xloc, &xinc,
! 	&yloc, &style, &vis, &scalarvis)) return 0;
      if (!vis) return 0;
      return array_doclick(array, canvas, sc, ap, elemtemplatesym, linewidth, basex + xloc, xinc,
! 	basey + yloc, scalarvis, &x->xpoints, &x->ypoints, &x->wpoints, xpix, ypix, shift, alt, dbl, doit);
  }
  
***************
*** 5257,5262 ****
  }
  
- /* -------------------- widget behavior for drawnumber ------------ */
- 
  #define DRAWNUMBER_BUFSIZE 80
  static void drawnumber_sprintf(t_drawnumber *x, char *buf, t_atom *ap) {
--- 5228,5231 ----





More information about the Pd-cvs mailing list