[PD-cvs] pd/src desire.c, 1.1.2.144, 1.1.2.145 desire.h, 1.1.2.19, 1.1.2.20

Mathieu Bouchard matju at users.sourceforge.net
Sun Sep 3 07:40:41 CEST 2006


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

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


Index: desire.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v
retrieving revision 1.1.2.19
retrieving revision 1.1.2.20
diff -C2 -d -r1.1.2.19 -r1.1.2.20
*** desire.h	3 Sep 2006 05:14:04 -0000	1.1.2.19
--- desire.h	3 Sep 2006 05:40:39 -0000	1.1.2.20
***************
*** 200,204 ****
  #define CURSOR_EDITMODE_DISCONNECT 6
  extern t_canvas *canvas_list; /* list of all root canvases */
! extern t_class *vinlet_class, *voutlet_class;
  extern int glist_valid;         /* incremented when pointers might be stale */
  
--- 200,204 ----
  #define CURSOR_EDITMODE_DISCONNECT 6
  extern t_canvas *canvas_list; /* list of all root canvases */
! extern t_class *vinlet_class, *voutlet_class, *canvas_class;
  extern int glist_valid;         /* incremented when pointers might be stale */
  
***************
*** 214,279 ****
  EXTERN void glist_init(t_glist *x);
  EXTERN void glist_add(t_glist *x, t_gobj *g);
- EXTERN t_canvas *glist_getcanvas(t_glist *x);
  EXTERN void glist_delete(t_glist *x, t_gobj *y);
  EXTERN int glist_isvisible(t_glist *x);
  EXTERN int glist_istoplevel(t_glist *x);
  EXTERN t_canvas *canvas_getcurrent(void);
! EXTERN void canvas_deletelinesfor(t_canvas *x, t_text *text);
! EXTERN void canvas_deletelinesforio(t_canvas *x, t_text *text, t_inlet *inp, t_outlet *outp);
  EXTERN void linetraverser_start(t_linetraverser *t, t_canvas *x);
  EXTERN t_outconnect *linetraverser_next(t_linetraverser *t);
  
! /* -------------------- TO BE SORTED OUT --------------------- */
! EXTERN void glist_read(t_glist *x, t_symbol *filename, t_symbol *format);
! EXTERN void glist_mergefile(t_glist *x, t_symbol *filename, t_symbol *format);
! EXTERN float glist_pixelstox(t_glist *x, float xpix);
! EXTERN float glist_pixelstoy(t_glist *x, float ypix);
! EXTERN float glist_xtopixels(t_glist *x, float xval);
! EXTERN float glist_ytopixels(t_glist *x, float yval);
! EXTERN float glist_dpixtodx(t_glist *x, float dxpix);
! EXTERN float glist_dpixtody(t_glist *x, float dypix);
! EXTERN void glist_getnextxy(t_glist *gl, int *xval, int *yval);
! EXTERN void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv);
! EXTERN t_glist *glist_addglist(t_glist *g, t_symbol *sym,
!     float  x1, float  y1, float  x2, float  y2,
!     float px1, float py1, float px2, float py2);
! EXTERN t_binbuf *glist_writetobinbuf(t_glist *x, int wholething);
! EXTERN int glist_isgraph(t_glist *x);
! EXTERN void glist_redraw(t_glist *x);
! EXTERN void canvas_create_editor(t_glist *x, int createit);
! EXTERN void text_setto(t_text *x, t_glist *glist, char *buf, int bufsize);
! EXTERN int text_xcoord(t_text *x, t_glist *glist);
! EXTERN int text_ycoord(t_text *x, t_glist *glist);
! EXTERN int text_xpix(  t_text *x, t_glist *glist);
! EXTERN int text_ypix(  t_text *x, t_glist *glist);
! EXTERN int text_shouldvis(t_text *x, t_glist *glist);
! 
! EXTERN t_class *canvas_class;
! EXTERN t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv);
  EXTERN t_symbol *canvas_makebindsym(t_symbol *s);
- EXTERN void canvas_vistext(t_canvas *x, t_text *y);
- EXTERN void canvas_redraw(t_canvas *x);
  
! EXTERN t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *sym, t_symbol* h);
! EXTERN void canvas_rminlet(t_canvas *x, t_inlet *ip);
! EXTERN t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *sym);
! EXTERN void canvas_rmoutlet(t_canvas *x, t_outlet *op);
  EXTERN void canvas_redrawallfortemplate(t_template *tmpl, int action);
  EXTERN void canvas_redrawallfortemplatecanvas(t_canvas *x, int action);
- EXTERN t_symbol *canvas_realizedollar(t_canvas *x, t_symbol *s);
- EXTERN t_canvas *canvas_getrootfor(t_canvas *x);
  EXTERN void canvas_dirty(t_canvas *x, t_int n);
- EXTERN void canvas_resortinlets(t_canvas *x);
- EXTERN void canvas_resortoutlets(t_canvas *x);
- EXTERN void canvas_free(t_canvas *x);
- EXTERN int canvas_isabstraction(t_canvas *x);
- EXTERN int canvas_istable(t_canvas *x);
  EXTERN int canvas_showtext(t_canvas *x);
  EXTERN void canvas_vis(t_canvas *x, t_floatarg f);
- EXTERN t_canvasenvironment *canvas_getenv(t_canvas *x);
  EXTERN void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir);
- EXTERN void canvas_loadbang(t_canvas *x);
- EXTERN int canvas_setdeleting(t_canvas *x, int flag);
- EXTERN int canvas_getindex(t_canvas *x, t_gobj *y);
  EXTERN void canvas_fattenforscalars(t_canvas *x, int *x1, int *y1, int *x2, int *y2);
  EXTERN void canvas_visforscalars(t_canvas *x, t_glist *glist, int vis);
--- 214,246 ----
  EXTERN void glist_init(t_glist *x);
  EXTERN void glist_add(t_glist *x, t_gobj *g);
  EXTERN void glist_delete(t_glist *x, t_gobj *y);
+ EXTERN void canvas_deletelinesfor(t_canvas *x, t_text *text);
+ EXTERN void canvas_deletelinesforio(t_canvas *x, t_text *text, t_inlet *inp, t_outlet *outp);
+ 
  EXTERN int glist_isvisible(t_glist *x);
  EXTERN int glist_istoplevel(t_glist *x);
+ EXTERN int canvas_istable(t_canvas *x);
+ EXTERN int canvas_isabstraction(t_canvas *x);
+ 
+ EXTERN t_canvas *glist_getcanvas(t_glist *x);
+ EXTERN t_canvas *canvas_getrootfor(t_canvas *x);
  EXTERN t_canvas *canvas_getcurrent(void);
! EXTERN int canvas_getindex(t_canvas *x, t_gobj *y);
! EXTERN t_canvasenvironment *canvas_getenv(t_canvas *x);
! 
  EXTERN void linetraverser_start(t_linetraverser *t, t_canvas *x);
  EXTERN t_outconnect *linetraverser_next(t_linetraverser *t);
  
! EXTERN t_symbol *canvas_realizedollar(t_canvas *x, t_symbol *s);
  EXTERN t_symbol *canvas_makebindsym(t_symbol *s);
  
! /* -------------------- TO BE SORTED OUT --------------------- */
! EXTERN void canvas_vistext(t_canvas *x, t_text *y);
  EXTERN void canvas_redrawallfortemplate(t_template *tmpl, int action);
  EXTERN void canvas_redrawallfortemplatecanvas(t_canvas *x, int action);
  EXTERN void canvas_dirty(t_canvas *x, t_int n);
  EXTERN int canvas_showtext(t_canvas *x);
  EXTERN void canvas_vis(t_canvas *x, t_floatarg f);
  EXTERN void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir);
  EXTERN void canvas_fattenforscalars(t_canvas *x, int *x1, int *y1, int *x2, int *y2);
  EXTERN void canvas_visforscalars(t_canvas *x, t_glist *glist, int vis);

Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.144
retrieving revision 1.1.2.145
diff -C2 -d -r1.1.2.144 -r1.1.2.145
*** desire.c	3 Sep 2006 05:14:01 -0000	1.1.2.144
--- desire.c	3 Sep 2006 05:40:38 -0000	1.1.2.145
***************
*** 477,481 ****
      its parent will be a "text" object in another window... we don't
      know which yet. */
! t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) {
      t_canvas *x = (t_canvas *)pd_new(canvas_class);
      t_canvas *owner = canvas_getcurrent();
--- 477,481 ----
      its parent will be a "text" object in another window... we don't
      know which yet. */
! static t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) {
      t_canvas *x = (t_canvas *)pd_new(canvas_class);
      t_canvas *owner = canvas_getcurrent();
***************
*** 550,557 ****
  }
  
  #define GLIST_DEFGRAPHWIDTH 200
  #define GLIST_DEFGRAPHHEIGHT 140
  /* make a new glist and add it to this glist.  It will appear as a "graph", not a text object.  */
! t_glist *glist_addglist(t_glist *g, t_symbol *sym,
      float  x1, float  y1, float  x2, float  y2,
      float px1, float py1, float px2, float py2) {
--- 550,559 ----
  }
  
+ static void canvas_create_editor(t_glist *x, int createit);
+ 
  #define GLIST_DEFGRAPHWIDTH 200
  #define GLIST_DEFGRAPHHEIGHT 140
  /* make a new glist and add it to this glist.  It will appear as a "graph", not a text object.  */
! static t_glist *glist_addglist(t_glist *g, t_symbol *sym,
      float  x1, float  y1, float  x2, float  y2,
      float px1, float py1, float px2, float py2) {
***************
*** 603,608 ****
  }
  
!     /* call glist_addglist from a Pd message */
! 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;
--- 605,609 ----
  }
  
! static 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;
***************
*** 611,617 ****
  }
  
! /* return true if the glist should appear as a graph on parent;
!    otherwise it appears as a text box. */
! int glist_isgraph(t_glist *x) {return x->gl_isgraph;}
  
  /* This is sent from the GUI to inform a toplevel that its window has been
--- 612,616 ----
  }
  
! static void canvas_redraw(t_canvas *x);
  
  /* This is sent from the GUI to inform a toplevel that its window has been
***************
*** 626,630 ****
      x->gl_screenx2 = x2;
      x->gl_screeny2 = y2;
!     if (!glist_isgraph(x) && (x->gl_y2 < x->gl_y1)) {
              /* if it's flipped so that y grows upward,
              fix so that zero is bottom edge and redraw.  This is
--- 625,629 ----
      x->gl_screenx2 = x2;
      x->gl_screeny2 = y2;
!     if (!x->gl_isgraph && (x->gl_y2 < x->gl_y1)) {
              /* if it's flipped so that y grows upward,
              fix so that zero is bottom edge and redraw.  This is
***************
*** 686,692 ****
  }
  
! void canvas_redraw(t_canvas *x) {
! 	if (glist_isvisible(x)) {canvas_map(x,0); canvas_map(x, 1);}
! }
  
  static t_editor *editor_new(t_glist *owner) {
--- 685,689 ----
  }
  
! static void canvas_redraw(t_canvas *x) {if (glist_isvisible(x)) {canvas_map(x,0); canvas_map(x, 1);}}
  
  static t_editor *editor_new(t_glist *owner) {
***************
*** 708,712 ****
  /* recursively create or destroy all editors of a glist and its
     sub-glists, as long as they aren't toplevels. */
! void canvas_create_editor(t_glist *x, int createit) {
      t_gobj *y;
      if (createit) {
--- 705,710 ----
  /* recursively create or destroy all editors of a glist and its
     sub-glists, as long as they aren't toplevels. */
! 
! static void canvas_create_editor(t_glist *x, int createit) {
      t_gobj *y;
      if (createit) {
***************
*** 753,757 ****
  	/* if we're a graph on our parent, and if the parent exists
  	   and is visible, show ourselves on parent. */
!         if (glist_isgraph(x) && x->gl_owner) {
              canvas_create_editor(x, 1);
              x->gl_havewindow = 0;
--- 751,755 ----
  	/* if we're a graph on our parent, and if the parent exists
  	   and is visible, show ourselves on parent. */
!         if (x->gl_isgraph && x->gl_owner) {
              canvas_create_editor(x, 1);
              x->gl_havewindow = 0;
***************
*** 790,794 ****
  }
  
! void canvas_free(t_canvas *x) {
      t_gobj *y;
      int dspstate = canvas_suspend_dsp();
--- 788,792 ----
  }
  
! static void canvas_free(t_canvas *x) {
      t_gobj *y;
      int dspstate = canvas_suspend_dsp();
***************
*** 840,843 ****
--- 838,844 ----
  }
  
+ static void canvas_resortinlets(t_canvas *x);
+ static void canvas_resortoutlets(t_canvas *x);
+ 
  static void canvas_pop(t_canvas *x, t_floatarg fvis) {
      if (fvis!=0) canvas_vis(x, 1);
***************
*** 885,888 ****
--- 886,891 ----
  }
  
+ static void canvas_loadbang(t_canvas *x);
+ 
  static void canvas_loadbangabstractions(t_canvas *x) {
      t_gobj *y;
***************
*** 906,910 ****
  }
  
! void canvas_loadbang(t_canvas *x) {
      canvas_loadbangabstractions(x);
      canvas_loadbangsubpatches(x);
--- 909,913 ----
  }
  
! static void canvas_loadbang(t_canvas *x) {
      canvas_loadbangabstractions(x);
      canvas_loadbangsubpatches(x);
***************
*** 1144,1147 ****
--- 1147,1152 ----
  /******************* redrawing  data *********************/
  
+ static void glist_redraw(t_glist *x);
+ 
  /* redraw all "scalars" (do this if a drawing command is changed.) 
     LATER we'll use the "template" information to select which ones we
***************
*** 1310,1316 ****
      any missing paramters and redraw things if necessary. */
  void canvas_setgraph(t_glist *x, int flag, int nogoprect) {
!     if (!flag && glist_isgraph(x)) {
          x->gl_isgraph = 0;
!     } else if (flag && !glist_isgraph(x)) {
          if (x->gl_pixwidth  <= 0) x->gl_pixwidth  = GLIST_DEFGRAPHWIDTH;
          if (x->gl_pixheight <= 0) x->gl_pixheight = GLIST_DEFGRAPHHEIGHT;
--- 1315,1321 ----
      any missing paramters and redraw things if necessary. */
  void canvas_setgraph(t_glist *x, int flag, int nogoprect) {
!     if (!flag && x->gl_isgraph) {
          x->gl_isgraph = 0;
!     } else if (flag && !x->gl_isgraph) {
          if (x->gl_pixwidth  <= 0) x->gl_pixwidth  = GLIST_DEFGRAPHWIDTH;
          if (x->gl_pixheight <= 0) x->gl_pixheight = GLIST_DEFGRAPHHEIGHT;
***************
*** 1330,1333 ****
--- 1335,1341 ----
  }
  
+ static float glist_dpixtodx(t_glist*x,float dxpix);
+ static float glist_dpixtody(t_glist*x,float dypix);
+ 
      /* called from the gui when "OK" is selected on the canvas properties
          dialog.  Again we negate "y" scale. */
***************
*** 1590,1594 ****
  static int canvas_last_glist_x, canvas_last_glist_y;
  
! void glist_getnextxy(t_glist *gl, int *xpix, int *ypix) {
      if (canvas_last_glist == gl)
          *xpix = canvas_last_glist_x, *ypix = canvas_last_glist_y;
--- 1598,1602 ----
  static int canvas_last_glist_x, canvas_last_glist_y;
  
! static void glist_getnextxy(t_glist *gl, int *xpix, int *ypix) {
      if (canvas_last_glist == gl)
          *xpix = canvas_last_glist_x, *ypix = canvas_last_glist_y;
***************
*** 1969,1972 ****
--- 1977,1983 ----
  }
  
+ static float glist_xtopixels(t_glist *x, float xval);
+ static float glist_ytopixels(t_glist *x, float yval);
+ 
      /* routine to get screen coordinates of a point in an array */
  void array_getcoordinate(t_glist *glist, char *elem, int xonset, int yonset, int wonset, int indx,
***************
*** 2246,2249 ****
--- 2257,2267 ----
  #define ARRAYWRITECHUNKSIZE 1000
  
+ static float glist_pixelstox(t_glist *x, float xpix);
+ static float glist_pixelstoy(t_glist *x, float xpix);
+ 
+ /* convert an X screen distance to an X coordinate increment. */
+ static float glist_dpixtodx(t_glist*x,float dxpix){return dxpix*(glist_pixelstox(x,1)-glist_pixelstox(x,0));}
+ static float glist_dpixtody(t_glist*x,float dypix){return dypix*(glist_pixelstoy(x,1)-glist_pixelstoy(x,0));}
+ 
  static void garray_save(t_gobj *z, t_binbuf *b) {
      int style, filestyle;
***************
*** 2732,2736 ****
  /* --------------- inlets and outlets  ----------- */
  
! t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *s, t_symbol* h) {
      t_inlet *ip = inlet_new(&x->gl_obj, who, s, 0);
      inlet_settip(ip,h);
--- 2750,2754 ----
  /* --------------- inlets and outlets  ----------- */
  
! static t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *s, t_symbol* h) {
      t_inlet *ip = inlet_new(&x->gl_obj, who, s, 0);
      inlet_settip(ip,h);
***************
*** 2740,2744 ****
  }
  
! void canvas_rminlet(t_canvas *x, t_inlet *ip) {
      t_canvas *owner = x->gl_owner;
      if (owner) canvas_deletelinesforio(owner, &x->gl_obj, ip, 0);
--- 2758,2762 ----
  }
  
! static void canvas_rminlet(t_canvas *x, t_inlet *ip) {
      t_canvas *owner = x->gl_owner;
      if (owner) canvas_deletelinesforio(owner, &x->gl_obj, ip, 0);
***************
*** 2750,2754 ****
  extern void obj_moveinletfirst(t_object *x, t_inlet *i);
  
! void canvas_resortinlets(t_canvas *x) {
      int ninlets = 0, i, j, xmax;
      t_gobj *y, **vec, **vp, **maxp;
--- 2768,2772 ----
  extern void obj_moveinletfirst(t_object *x, t_inlet *i);
  
! static void canvas_resortinlets(t_canvas *x) {
      int ninlets = 0, i, j, xmax;
      t_gobj *y, **vec, **vp, **maxp;
***************
*** 2777,2781 ****
  }
  
! t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *s) {
      t_outlet *op = outlet_new(&x->gl_obj, s);
      if (!x->gl_loading) canvas_resortoutlets(x);
--- 2795,2799 ----
  }
  
! static t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *s) {
      t_outlet *op = outlet_new(&x->gl_obj, s);
      if (!x->gl_loading) canvas_resortoutlets(x);
***************
*** 2784,2788 ****
  }
  
! void canvas_rmoutlet(t_canvas *x, t_outlet *op) {
      t_canvas *owner = x->gl_owner;
      if (owner) canvas_deletelinesforio(owner, &x->gl_obj, 0, op);
--- 2802,2806 ----
  }
  
! static void canvas_rmoutlet(t_canvas *x, t_outlet *op) {
      t_canvas *owner = x->gl_owner;
      if (owner) canvas_deletelinesforio(owner, &x->gl_obj, 0, op);
***************
*** 2794,2798 ****
  extern void obj_moveoutletfirst(t_object *x, t_outlet *i);
  
! void canvas_resortoutlets(t_canvas *x) {
      int noutlets = 0, i, j, xmax;
      t_gobj *y, **vec, **vp, **maxp;
--- 2812,2816 ----
  extern void obj_moveoutletfirst(t_object *x, t_outlet *i);
  
! static void canvas_resortoutlets(t_canvas *x) {
      int noutlets = 0, i, j, xmax;
      t_gobj *y, **vec, **vp, **maxp;
***************
*** 2887,2891 ****
   so get our screen rectangle on parent and transform. */
  
! float glist_pixelstox(t_glist *x, float xpix) {
      int x1, y1, x2, y2;
      float width = x->gl_x2-x->gl_x1;
--- 2905,2909 ----
   so get our screen rectangle on parent and transform. */
  
! static float glist_pixelstox(t_glist *x, float xpix) {
      int x1, y1, x2, y2;
      float width = x->gl_x2-x->gl_x1;
***************
*** 2896,2900 ****
      return x->gl_x1 + width * (xpix-x1) / (x2-x1);
  }
! float glist_pixelstoy(t_glist *x, float ypix) {
      int x1, y1, x2, y2;
      float height = x->gl_y2-x->gl_y1;
--- 2914,2918 ----
      return x->gl_x1 + width * (xpix-x1) / (x2-x1);
  }
! static float glist_pixelstoy(t_glist *x, float ypix) {
      int x1, y1, x2, y2;
      float height = x->gl_y2-x->gl_y1;
***************
*** 2907,2911 ****
  
  /* convert an x coordinate value to an x pixel location in window */
! float glist_xtopixels(t_glist *x, float xval) {
      int x1, y1, x2, y2;
      float width = x->gl_x2-x->gl_x1;
--- 2925,2929 ----
  
  /* convert an x coordinate value to an x pixel location in window */
! static float glist_xtopixels(t_glist *x, float xval) {
      int x1, y1, x2, y2;
      float width = x->gl_x2-x->gl_x1;
***************
*** 2916,2920 ****
      return x1 + (x2 - x1) * (xval - x->gl_x1) / width;
  }
! float glist_ytopixels(t_glist *x, float yval) {
      int x1, y1, x2, y2;
      float height = x->gl_y2-x->gl_y1;
--- 2934,2938 ----
      return x1 + (x2 - x1) * (xval - x->gl_x1) / width;
  }
! static float glist_ytopixels(t_glist *x, float yval) {
      int x1, y1, x2, y2;
      float height = x->gl_y2-x->gl_y1;
***************
*** 2926,2933 ****
  }
  
- /* convert an X screen distance to an X coordinate increment. */
- float glist_dpixtodx(t_glist *x, float dxpix) {return dxpix*(glist_pixelstox(x, 1)-glist_pixelstox(x, 0));}
- float glist_dpixtody(t_glist *x, float dypix) {return dypix*(glist_pixelstoy(x, 1)-glist_pixelstoy(x, 0));}
- 
  /* get the window location in pixels of a "text" object.  The
  object's x and y positions are in pixels when the glist they're
--- 2944,2947 ----
***************
*** 2936,2945 ****
  as an offset into the parent rectangle.  Finally, it might be an old,
  proportional-style GOP.  In this case we do a coordinate transformation. */
! int text_xpix(t_text *x, t_glist *glist) {
      if (glist->gl_havewindow || !glist->gl_isgraph) return x->te_xpix;
      if (glist->gl_goprect) return glist->gl_obj.te_xpix + x->te_xpix - glist->gl_xmargin;
      return glist_xtopixels(glist, glist->gl_x1 + (glist->gl_x2 - glist->gl_x1) * x->te_xpix / (glist->gl_screenx2 - glist->gl_screenx1));
  }
! int text_ypix(t_text *x, t_glist *glist) {
      if (glist->gl_havewindow || !glist->gl_isgraph) return x->te_ypix;
      if (glist->gl_goprect) return glist->gl_obj.te_ypix + x->te_ypix - glist->gl_ymargin;
--- 2950,2959 ----
  as an offset into the parent rectangle.  Finally, it might be an old,
  proportional-style GOP.  In this case we do a coordinate transformation. */
! static int text_xpix(t_text *x, t_glist *glist) {
      if (glist->gl_havewindow || !glist->gl_isgraph) return x->te_xpix;
      if (glist->gl_goprect) return glist->gl_obj.te_xpix + x->te_xpix - glist->gl_xmargin;
      return glist_xtopixels(glist, glist->gl_x1 + (glist->gl_x2 - glist->gl_x1) * x->te_xpix / (glist->gl_screenx2 - glist->gl_screenx1));
  }
! static int text_ypix(t_text *x, t_glist *glist) {
      if (glist->gl_havewindow || !glist->gl_isgraph) return x->te_ypix;
      if (glist->gl_goprect) return glist->gl_obj.te_ypix + x->te_ypix - glist->gl_ymargin;
***************
*** 2947,2957 ****
  }
  
! /* redraw all the items in a glist.  We construe this to mean
!    redrawing in its own window and on parent, as needed in each case.
!    This is too conservative -- for instance, when you draw an "open"
!    rectangle on the parent, you shouldn't have to redraw the window!  */
! void glist_redraw(t_glist *x) {
      if (glist_isvisible(x)) {
-         /* LATER fix the graph_vis() code to handle both cases */
          if (glist_istoplevel(x)) {
              t_gobj *g;
--- 2961,2969 ----
  }
  
! /* redraw all the items in a glist.  We construe this to mean redrawing in its own window and
!    on parent, as needed in each case. This is too conservative -- for instance, when you draw an
!    "open" rectangle on the parent, you shouldn't have to redraw the window! */
! static void glist_redraw(t_glist *x) {
      if (glist_isvisible(x)) {
          if (glist_istoplevel(x)) {
              t_gobj *g;
***************
*** 3392,3397 ****
  }
  
! void glist_read(t_glist *x, t_symbol *filename, t_symbol *format)      {glist_doread(x,filename,format,1);}
! void glist_mergefile(t_glist *x, t_symbol *filename, t_symbol *format) {glist_doread(x,filename,format,0);}
  
  /* read text from a "properties" window, called from a gfxstub set
--- 3404,3409 ----
  }
  
! static void glist_read(t_glist *x, t_symbol *filename, t_symbol *format)      {glist_doread(x,filename,format,1);}
! static void glist_mergefile(t_glist *x, t_symbol *filename, t_symbol *format) {glist_doread(x,filename,format,0);}
  
  /* read text from a "properties" window, called from a gfxstub set
***************
*** 3543,3547 ****
  
      /* write all "scalars" in a glist to a binbuf. */
! t_binbuf *glist_writetobinbuf(t_glist *x, int wholething) {
      int i;
      t_symbol **templatevec = (t_symbol **)getbytes(0);
--- 3555,3559 ----
  
      /* write all "scalars" in a glist to a binbuf. */
! static t_binbuf *glist_writetobinbuf(t_glist *x, int wholething) {
      int i;
      t_symbol **templatevec = (t_symbol **)getbytes(0);
***************
*** 4206,4211 ****
      t_voutlet *x = (t_voutlet *)pd_new(voutlet_class);
      x->x_canvas = canvas_getcurrent();
!     x->x_parentoutlet = canvas_addoutlet(x->x_canvas,
!         &x->x_obj.ob_pd, &s_signal);
      inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal);
      x->x_endbuf = x->x_buf = (t_float *)getalignedbytes(0);
--- 4218,4222 ----
      t_voutlet *x = (t_voutlet *)pd_new(voutlet_class);
      x->x_canvas = canvas_getcurrent();
!     x->x_parentoutlet = canvas_addoutlet(x->x_canvas, &x->x_obj.ob_pd, &s_signal);
      inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal);
      x->x_endbuf = x->x_buf = (t_float *)getalignedbytes(0);
***************
*** 7398,7402 ****
  }
  
! void text_setto(t_text *x, t_glist *glist, char *buf, int bufsize) {
      if (x->te_type == T_OBJECT) {
  	t_binbuf *b = binbuf_new();
--- 7409,7413 ----
  }
  
! static void text_setto(t_text *x, t_glist *glist, char *buf, int bufsize) {
      if (x->te_type == T_OBJECT) {
  	t_binbuf *b = binbuf_new();





More information about the Pd-cvs mailing list