[PD-cvs] pd/src desire.c,1.1.2.24,1.1.2.25

Mathieu Bouchard matju at users.sourceforge.net
Sat Sep 24 04:03:14 CEST 2005


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

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.24
retrieving revision 1.1.2.25
diff -C2 -d -r1.1.2.24 -r1.1.2.25
*** desire.c	22 Sep 2005 07:35:16 -0000	1.1.2.24
--- desire.c	24 Sep 2005 02:03:11 -0000	1.1.2.25
***************
*** 312,317 ****
              if (!t->tr_ob) y = t->tr_x->gl_list;
              else y = t->tr_ob->ob_g.g_next;
!             for (; y; y = y->g_next)
!                 if (ob = pd_checkobject(&y->g_pd)) break;
              if (!ob) return (0);
              t->tr_ob = ob;
--- 312,316 ----
              if (!t->tr_ob) y = t->tr_x->gl_list;
              else y = t->tr_ob->ob_g.g_next;
!             for (; y; y = y->g_next) if ((ob = pd_checkobject(&y->g_pd))) break;
              if (!ob) return (0);
              t->tr_ob = ob;
***************
*** 507,519 ****
          would be confusing.  The "correct" way is to have "py1" be the value
          that is higher on the screen. */
!     if (py2 < py1)
!     {
!         float zz;
!         zz = y2;
!         y2 = y1;
!         y1 = zz;
!         zz = py2;
!         py2 = py1;
!         py1 = zz;
      }
      if (x1 == x2 || y1 == y2)
--- 506,512 ----
          would be confusing.  The "correct" way is to have "py1" be the value
          that is higher on the screen. */
!     if (py2 < py1) {
!         float zz =  y2;  y2 =  y1;  y1 = zz;
!         zz       = py2; py2 = py1; py1 = zz;
      }
      if (x1 == x2 || y1 == y2)
***************
*** 633,639 ****
      }
      else namebuf[0] = 0;
!     sys_vgui("%lx window_title {%s%c%s - %s}\n", 
!         x, x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf,
              canvas_getdir(x)->s_name);
  }
  
--- 626,633 ----
      }
      else namebuf[0] = 0;
!     char foo[666];
!     sprintf("%s%c%s - %s",x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf,
              canvas_getdir(x)->s_name);
+     sys_mgui(x,"window_title",foo);
  }
  
***************
*** 789,795 ****
              canvas_vis(x, 1);
  #else
!             sys_vgui(x,"window_raise","");
!             sys_vgui(x,"window_focus","");
!             sys_vgui(x,"window_deiconify","");  
  #endif
          }
--- 783,789 ----
              canvas_vis(x, 1);
  #else
!             sys_mgui(x,"window_raise","");
!             sys_mgui(x,"window_focus","");
!             sys_mgui(x,"window_deiconify","");  
  #endif
          }
***************
*** 1048,1052 ****
  void canvas_loadbang(t_canvas *x)
  {
-     t_gobj *y;
      canvas_loadbangabstractions(x);
      canvas_loadbangsubpatches(x);
--- 1042,1045 ----
***************
*** 1124,1128 ****
  void canvas_fattensub(t_canvas *x, int *xp1, int *yp1, int *xp2, int *yp2)
  {
-     t_gobj *y;
      *xp2 += 50;     /* fake for now */
      *yp2 += 50;
--- 1117,1120 ----
***************
*** 1367,1371 ****
      for (g = gl->gl_list; g; g = g->g_next)
      {
-         t_class *cl;
          if (vis && g->g_pd == scalar_class)
          {
--- 1359,1362 ----
***************
*** 7825,7837 ****
  }
  
- 
- /* ---------------------------- overall setup ----------------------------- */
- 
- void g_io_setup(void)
- {
-     vinlet_setup();
-     voutlet_setup();
- }
- 
  //--------------------------------------------------------------------------
  // from g_scalar.c
--- 7816,7819 ----
***************
*** 10262,10289 ****
      t_drawnumber *x = (t_drawnumber *)z;
      t_atom at;
!         int xloc, yloc, font, fontwidth, fontheight;
      char buf[DRAWNUMBER_BUFSIZE];
! 
!     if (!fielddesc_getfloat(&x->x_vis, template, data, 0))
!     {
          *xp1 = *yp1 = 0x7fffffff;
          *xp2 = *yp2 = -0x7fffffff;
          return;
      }
!     xloc = glist_xtopixels(glist,
!         basex + fielddesc_getcoord(&x->x_xloc, template, data, 0));
!     yloc = glist_ytopixels(glist,
!         basey + fielddesc_getcoord(&x->x_yloc, template, data, 0));
!     font = glist_getfont(glist);
!     fontwidth = sys_fontwidth(font);
!         fontheight = sys_fontheight(font);
      if (x->x_flags & DRAW_SYMBOL)
          SETSYMBOL(&at, fielddesc_getsymbol(&x->x_value, template, data, 0));
!     else SETFLOAT(&at, fielddesc_getfloat(&x->x_value, template, data, 0));
      drawnumber_sprintf(x, buf, &at);
      *xp1 = xloc;
      *yp1 = yloc;
!     *xp2 = xloc + fontwidth * strlen(buf);
!     *yp2 = yloc + fontheight;
  }
  
--- 10244,10264 ----
      t_drawnumber *x = (t_drawnumber *)z;
      t_atom at;
!     int xloc, yloc;
      char buf[DRAWNUMBER_BUFSIZE];
!     if (!fielddesc_getfloat(&x->x_vis, template, data, 0)) {
          *xp1 = *yp1 = 0x7fffffff;
          *xp2 = *yp2 = -0x7fffffff;
          return;
      }
!     xloc = glist_xtopixels(glist, basex + fielddesc_getcoord(&x->x_xloc, template, data, 0));
!     yloc = glist_ytopixels(glist, basey + fielddesc_getcoord(&x->x_yloc, template, data, 0));
      if (x->x_flags & DRAW_SYMBOL)
          SETSYMBOL(&at, fielddesc_getsymbol(&x->x_value, template, data, 0));
!     else SETFLOAT(&at,  fielddesc_getfloat(&x->x_value, template, data, 0));
      drawnumber_sprintf(x, buf, &at);
      *xp1 = xloc;
      *yp1 = yloc;
!     *xp2 = xloc + 42;
!     *yp2 = yloc + 42;
  }
  
***************
*** 11644,11648 ****
      double   k;
      char     buf[32];
-     int      numwidth;
      int      log_height;
      int      finemoved;
--- 11619,11622 ----
***************
*** 13205,13219 ****
  static t_class *nbclass;
  
! void nbclip(t_nbx *x) {CLAMP(x->val,x->min,x->max);}
! 
! void nbcalc_fontwidth(t_nbx *x)
! {
!     int f = x->font_style==1 ? 27 : x->font_style==2 ? 25 : 31;
!     int w = x->fontsize * f * x->w / 36;
!     x->numwidth = w + 4 + x->h/2;
!     post("nbx calc_fontwidth: f=%d w=%d numwidth=%d",f,w,x->numwidth);
! }
  
! int nbcheck_minmax(t_nbx *x)
  {
      double min=x->min, max=x->max;
--- 13179,13185 ----
  static t_class *nbclass;
  
! static void nbclip(t_nbx *x) {CLAMP(x->val,x->min,x->max);}
  
! static int nbcheck_minmax(t_nbx *x)
  {
      double min=x->min, max=x->max;
***************
*** 13253,13257 ****
      x->w = MAX(1,(int)atom_getintarg(0, ac, av));
      if(ac > 1) x->h = MAX(8,(int)atom_getintarg(1, ac, av));
-     nbcalc_fontwidth(x);
      iemgui_size((t_iemgui *)x);
  }
--- 13219,13222 ----
***************
*** 13300,13304 ****
      iemgui_constrain((t_iemgui *)x);
      x->w=MAX(w,1);
-     nbcalc_fontwidth(x);
      nbcheck_minmax(x);
      x->w = MAX(x->w,1);
--- 13265,13268 ----
***************
*** 13321,13329 ****
      outlet_new((t_text *)x, &s_float);
      nbreload(x,0,argc,argv);
-     nbcalc_fontwidth(x);
      return x;
  }
  
! static void g_numbosetup(void)
  {
      t_class *c = nbclass = class_new(gensym("nbx"), (t_newmethod)nbnew,
--- 13285,13292 ----
      outlet_new((t_text *)x, &s_float);
      nbreload(x,0,argc,argv);
      return x;
  }
  
! static void g_numbox_setup(void)
  {
      t_class *c = nbclass = class_new(gensym("nbx"), (t_newmethod)nbnew,
***************
*** 13340,13344 ****
      class_addmethod(c, (t_method)nbsize,     gensym("size"), A_GIMME, 0);
      class_addmethod(c, (t_method)nbrange,     gensym("range"), A_GIMME, 0);
-     /* !@#$ actually overrode label_font to do stuff related to width */
      class_addmethod(c, (t_method)nblog, gensym("log"), 0);
      class_addmethod(c, (t_method)nblin, gensym("lin"), 0);
--- 13303,13306 ----
***************
*** 13601,13615 ****
  }
  
- void desire_setup(void) {
-     g_text_setup();
-     g_bang_setup();
-     g_toggle_setup();
-     g_radio_setup();
-     g_slider_setup();
-     g_numbosetup();
-     g_mycanvas_setup();
-     g_vumeter_setup();
-     g_dropper_setup();
- }
  
  //-----------
--- 13563,13566 ----
***************
*** 13624,13628 ****
              /* here is the real creator function, invoked in patch files
              by sending the "canvas" message to #N, which is bound
!             to pd_camvasmaker. */
      class_addmethod(pd_canvasmaker, (t_method)canvas_new, gensym("canvas"), A_GIMME, 0);
      class_addmethod(c, (t_method)canvas_restore, gensym("restore"), A_GIMME, 0);
--- 13575,13579 ----
              /* here is the real creator function, invoked in patch files
              by sending the "canvas" message to #N, which is bound
!             to pd_canvasmaker. */
      class_addmethod(pd_canvasmaker, (t_method)canvas_new, gensym("canvas"), A_GIMME, 0);
      class_addmethod(c, (t_method)canvas_restore, gensym("restore"), A_GIMME, 0);
***************
*** 13713,13714 ****
--- 13664,13673 ----
  }
  
+ void desire_setup(void) {
+ #define S(x) x##_setup();
+     S(vinlet) S(voutlet)
+     S(g_array) S(g_canvas) S(g_guiconnect) S(g_scalar) S(g_template)
+     S(g_traversal) S(g_text) S(g_bang) S(g_toggle) S(g_radio)
+     S(g_slider) S(g_numbox) S(g_mycanvas) S(g_vumeter) S(g_dropper)
+ #undef S
+ }





More information about the Pd-cvs mailing list