[PD-cvs] pd/src g_all_guis.c,1.1.1.4.2.4.2.9,1.1.1.4.2.4.2.10 g_bang.c,1.1.1.3.2.2.2.8,1.1.1.3.2.2.2.9 g_graph.c,1.1.1.3.2.3.2.3,1.1.1.3.2.3.2.4 g_hdial.c,1.1.1.4.2.2.2.7,1.1.1.4.2.2.2.8 g_hslider.c,1.1.1.3.2.2.2.8,1.1.1.3.2.2.2.9 g_io.c,1.1.1.1.16.2.2.1,1.1.1.1.16.2.2.2 g_numbox.c,1.1.1.4.2.2.2.6,1.1.1.4.2.2.2.7 g_toggle.c,1.1.1.3.2.2.2.6,1.1.1.3.2.2.2.7

Mathieu Bouchard matju at users.sourceforge.net
Sun Mar 28 10:21:44 CEST 2004


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

Modified Files:
      Tag: impd_0_37
	g_all_guis.c g_bang.c g_graph.c g_hdial.c g_hslider.c g_io.c 
	g_numbox.c g_toggle.c 
Log Message:
bug fixes and deleting more code


Index: g_toggle.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_toggle.c,v
retrieving revision 1.1.1.3.2.2.2.6
retrieving revision 1.1.1.3.2.2.2.7
diff -C2 -d -r1.1.1.3.2.2.2.6 -r1.1.1.3.2.2.2.7
*** g_toggle.c	28 Mar 2004 07:21:18 -0000	1.1.1.3.2.2.2.6
--- g_toggle.c	28 Mar 2004 08:21:42 -0000	1.1.1.3.2.2.2.7
***************
*** 27,44 ****
  
  void toggle_draw(t_toggle *x, t_glist *glist, int mode) {
! switch(mode) {
! default:
  	pd_upload((t_gobj *)x);
  	sys_mgui((t_iemgui *)x,"toggle","draw","");
- 	/* fallthru */
- case IEM_GUI_DRAW_MODE_UPDATE:
  	if(glist_isvisible(glist)) sys_mgui((t_iemgui *)x,"toggle","set","i",x->x_on!=0.0);
- 	break;
- case IEM_GUI_DRAW_MODE_ERASE:
- 	sys_mgui((t_iemgui *)x,"toggle","erase","");
- 	break;
- case IEM_GUI_DRAW_MODE_SELECT:
- 	sys_mgui((t_iemgui *)x,"toggle","erase","i",x->x_gui.x_fsf.x_selected);
- 	break;
  }}
  
--- 27,37 ----
  
  void toggle_draw(t_toggle *x, t_glist *glist, int mode) {
! if (mode==IEM_GUI_DRAW_MODE_ERASE) sys_mgui((t_iemgui *)x,"toggle","erase","");
! else if (mode==IEM_GUI_DRAW_MODE_SELECT) 
! 	sys_mgui((t_iemgui *)x,"toggle","select","i",x->x_gui.x_fsf.x_selected);
! else {
  	pd_upload((t_gobj *)x);
  	sys_mgui((t_iemgui *)x,"toggle","draw","");
  	if(glist_isvisible(glist)) sys_mgui((t_iemgui *)x,"toggle","set","i",x->x_on!=0.0);
  }}
  
***************
*** 178,198 ****
  }
  
- static void toggle_delta(t_toggle *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
- static void toggle_pos(t_toggle *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
- static void toggle_color(t_toggle *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_color((void *)x, &x->x_gui, s, ac, av);}
- static void toggle_send(t_toggle *x, t_symbol *s)
- {iemgui_send(x, &x->x_gui, s);}
- static void toggle_receive(t_toggle *x, t_symbol *s)
- {iemgui_receive(x, &x->x_gui, s);}
- static void toggle_label(t_toggle *x, t_symbol *s)
- {iemgui_label((void *)x, &x->x_gui, s);}
- static void toggle_label_font(t_toggle *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
- static void toggle_label_pos(t_toggle *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
- 
  static void toggle_init(t_toggle *x, t_floatarg f)
  {x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1;}
--- 171,174 ----
***************
*** 255,280 ****
  void g_toggle_setup(void)
  {
!     toggle_class = class_new(gensym("tgl"), (t_newmethod)toggle_new,
  			     (t_method)toggle_ff, sizeof(t_toggle), 0, A_GIMME, 0);
      class_addcreator((t_newmethod)toggle_new, gensym("toggle"), A_GIMME, 0);
!     class_addbang(toggle_class, toggle_bang);
!     class_addfloat(toggle_class, toggle_float);
!     class_addmethod(toggle_class, (t_method)toggle_click, gensym("click"),
  		    A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
!     class_addmethod(toggle_class, (t_method)toggle_dialog, gensym("dialog"),
  		    A_GIMME, 0);
!     class_addmethod(toggle_class, (t_method)toggle_loadbang, gensym("loadbang"), 0);
!     class_addmethod(toggle_class, (t_method)toggle_set, gensym("set"), A_FLOAT, 0);
!     class_addmethod(toggle_class, (t_method)toggle_size, gensym("size"), A_GIMME, 0);
!     class_addmethod(toggle_class, (t_method)toggle_delta, gensym("delta"), A_GIMME, 0);
!     class_addmethod(toggle_class, (t_method)toggle_pos, gensym("pos"), A_GIMME, 0);
!     class_addmethod(toggle_class, (t_method)toggle_color, gensym("color"), A_GIMME, 0);
!     class_addmethod(toggle_class, (t_method)toggle_send, gensym("send"), A_DEFSYM, 0);
!     class_addmethod(toggle_class, (t_method)toggle_receive, gensym("receive"), A_DEFSYM, 0);
!     class_addmethod(toggle_class, (t_method)toggle_label, gensym("label"), A_DEFSYM, 0);
!     class_addmethod(toggle_class, (t_method)toggle_label_pos, gensym("label_pos"), A_GIMME, 0);
!     class_addmethod(toggle_class, (t_method)toggle_label_font, gensym("label_font"), A_GIMME, 0);
!     class_addmethod(toggle_class, (t_method)toggle_init, gensym("init"), A_FLOAT, 0);
!     class_addmethod(toggle_class, (t_method)toggle_nonzero, gensym("nonzero"), A_FLOAT, 0);
      toggle_widgetbehavior.w_getrectfn = toggle_getrect;
      toggle_widgetbehavior.w_displacefn = iemgui_displace;
--- 231,251 ----
  void g_toggle_setup(void)
  {
!     t_class *c = toggle_class = class_new(gensym("tgl"), (t_newmethod)toggle_new,
  			     (t_method)toggle_ff, sizeof(t_toggle), 0, A_GIMME, 0);
      class_addcreator((t_newmethod)toggle_new, gensym("toggle"), A_GIMME, 0);
!     class_addbang(c, toggle_bang);
!     class_addfloat(c, toggle_float);
!     class_addmethod(c, (t_method)toggle_click, gensym("click"),
  		    A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
!     class_addmethod(c, (t_method)toggle_dialog, gensym("dialog"),
  		    A_GIMME, 0);
!     class_addmethod(c, (t_method)toggle_loadbang, gensym("loadbang"), 0);
!     class_addmethod(c, (t_method)toggle_set, gensym("set"), A_FLOAT, 0);
!     class_addmethod(c, (t_method)toggle_size, gensym("size"), A_GIMME, 0);
! 
!     iemgui_register_class(c);
! 
!     class_addmethod(c, (t_method)toggle_init, gensym("init"), A_FLOAT, 0);
!     class_addmethod(c, (t_method)toggle_nonzero, gensym("nonzero"), A_FLOAT, 0);
      toggle_widgetbehavior.w_getrectfn = toggle_getrect;
      toggle_widgetbehavior.w_displacefn = iemgui_displace;
***************
*** 284,290 ****
      toggle_widgetbehavior.w_visfn = iemgui_vis;
      toggle_widgetbehavior.w_clickfn = toggle_newclick;
!     class_setwidget(toggle_class, &toggle_widgetbehavior);
!     class_sethelpsymbol(toggle_class, gensym("toggle"));
!     class_setsavefn(toggle_class, toggle_save);
!     class_setpropertiesfn(toggle_class, toggle_properties);
  }
--- 255,261 ----
      toggle_widgetbehavior.w_visfn = iemgui_vis;
      toggle_widgetbehavior.w_clickfn = toggle_newclick;
!     class_setwidget(c, &toggle_widgetbehavior);
!     class_sethelpsymbol(c, gensym("toggle"));
!     class_setsavefn(c, toggle_save);
!     class_setpropertiesfn(c, toggle_properties);
  }

Index: g_graph.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_graph.c,v
retrieving revision 1.1.1.3.2.3.2.3
retrieving revision 1.1.1.3.2.3.2.4
diff -C2 -d -r1.1.1.3.2.3.2.3 -r1.1.1.3.2.3.2.4
*** g_graph.c	28 Mar 2004 07:21:17 -0000	1.1.1.3.2.3.2.3
--- g_graph.c	28 Mar 2004 08:21:42 -0000	1.1.1.3.2.3.2.4
***************
*** 14,17 ****
--- 14,19 ----
  #include <string.h>
  
+ #define CLAMP(_var,_min,_max) { if (_var<_min) _var=_min; else if (_var>_max) _var=_max; }
+ 
  /* ---------------------- forward definitions ----------------- */
  
***************
*** 831,838 ****
  	{
  	    text_widgetbehavior.w_getrectfn(z, glist, &x21, &y21, &x22, &y22);
!     	    if (x22 > x2) 
! 		x2 = x22;
!     	    if (y22 > y2) 
! 		y2 = y22;
  	}
  	    /* lie about whether we have our own window to affect gobj_getrect
--- 833,838 ----
  	{
  	    text_widgetbehavior.w_getrectfn(z, glist, &x21, &y21, &x22, &y22);
!     	    if (x2<x22) x2=x22;
!     	    if (y2<y22) y2=y22;
  	}
  	    /* lie about whether we have our own window to affect gobj_getrect
***************
*** 848,855 ****
  	    	continue;
      	    gobj_getrect(g, x, &x21, &y21, &x22, &y22);
!     	    if (x22 > x2) 
! 	    	x2 = x22;
!     	    if (y22 > y2) 
! 	    	y2 = y22;
      	}
  	x->gl_havewindow = hadwindow;
--- 848,853 ----
  	    	continue;
      	    gobj_getrect(g, x, &x21, &y21, &x22, &y22);
!     	    if (x2<x22) x2=x22;
!     	    if (y2<y22) y2=y22;
      	}
  	x->gl_havewindow = hadwindow;
***************
*** 947,956 ****
      if (!garray_getfloatarray(a, &nelem, &vec))
      	return;
!     if (oldx < 0) oldx = 0;
!     if (oldx >= nelem)
!     	oldx = nelem - 1;
!     if (newx < 0) newx = 0;
!     if (newx >= nelem)
!     	newx = nelem - 1;
      if (oldx < newx - 1)
      {
--- 945,950 ----
      if (!garray_getfloatarray(a, &nelem, &vec))
      	return;
!     CLAMP(oldx,0,nelem-1);
!     CLAMP(newx,0,nelem-1);
      if (oldx < newx - 1)
      {
***************
*** 1047,1056 ****
  static void graph_dialog(t_glist *x, t_symbol *s, int argc, t_atom *argv)
  {
!     t_float x1 = atom_getfloatarg(0, argc, argv);
!     t_float y1 = atom_getfloatarg(1, argc, argv);
!     t_float x2 = atom_getfloatarg(2, argc, argv);
!     t_float y2 = atom_getfloatarg(3, argc, argv);
!     t_float xpix = atom_getfloatarg(4, argc, argv);
!     t_float ypix = atom_getfloatarg(5, argc, argv);
      if (x1 != x->gl_x1 || x2 != x->gl_x2 ||
      	y1 != x->gl_y1 || y2 != x->gl_y2)
--- 1041,1046 ----
  static void graph_dialog(t_glist *x, t_symbol *s, int argc, t_atom *argv)
  {
!     t_float x1,y1,x2,y2,xpix,ypix;
!     pd_scanargs(argc,argv,"ffffff",&x1,&y1,&x2,&y2,&xpix,&ypix);
      if (x1 != x->gl_x1 || x2 != x->gl_x2 ||
      	y1 != x->gl_y1 || y2 != x->gl_y2)

Index: g_hdial.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v
retrieving revision 1.1.1.4.2.2.2.7
retrieving revision 1.1.1.4.2.2.2.8
diff -C2 -d -r1.1.1.4.2.2.2.7 -r1.1.1.4.2.2.2.8
*** g_hdial.c	28 Mar 2004 07:21:17 -0000	1.1.1.4.2.2.2.7
--- g_hdial.c	28 Mar 2004 08:21:42 -0000	1.1.1.4.2.2.2.8
***************
*** 19,22 ****
--- 19,24 ----
  #include <math.h>
  
+ #define CLAMP(_var,_min,_max) { if (_var<_min) _var=_min; else if (_var>_max) _var=_max; }
+ 
  t_widgetbehavior hradio_widgetbehavior;
  static t_class *hradio_class, *hradio_old_class;
***************
*** 34,57 ****
  static void hradio_draw(t_hradio *x, t_glist *glist, int mode)
  {
! t_canvas *canvas=glist_getcanvas(glist);
! switch(mode) {
! case IEM_GUI_DRAW_MODE_UPDATE:
!     if(glist_isvisible(glist)) {
! 	t_canvas *canvas=glist_getcanvas(glist);
!         sys_vgui("radio_set %x .x%x.c %d\n",x,canvas,x->x_on);
      }
! break;
! case IEM_GUI_DRAW_MODE_SELECT:
!     sys_vgui("radio_select %x .x%x.c %d\n", x, canvas, x->x_gui.x_fsf.x_selected);
! break;
! case IEM_GUI_DRAW_MODE_ERASE:
!     sys_vgui("radio_erase %x .x%x.c\n", x, canvas);
! break;
! default:
!     pd_upload((t_gobj *)x);
!     sys_vgui("radio_draw %x .x%x.c\n", x, canvas);
!     sys_vgui("radio_set %x .x%x.c %d\n",x,canvas,x->x_on);
! break;
! }}
  
  /* ------------------------ hdl widgetbehaviour----------------------------- */
--- 36,49 ----
  static void hradio_draw(t_hradio *x, t_glist *glist, int mode)
  {
!     if (mode==IEM_GUI_DRAW_MODE_ERASE) {
! 	sys_mgui((t_iemgui *)x,"radio","erase","");
!     } else if (mode==IEM_GUI_DRAW_MODE_SELECT) {
! 	sys_mgui((t_iemgui *)x,"radio","select","i",x->x_gui.x_fsf.x_selected);
!     } else {
! 	pd_upload((t_gobj *)x);
! 	sys_mgui((t_iemgui *)x,"radio","draw","");
! 	sys_mgui((t_iemgui *)x,"radio","set","i",x->x_on);
      }
! }
  
  /* ------------------------ hdl widgetbehaviour----------------------------- */
***************
*** 138,144 ****
      else
      {
! 	(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_CONFIG);
!         (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_IO + sr_flags);
! 	(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_MOVE);
  	canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
      }
--- 130,134 ----
      else
      {
! 	(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_NEW);
  	canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
      }
***************
*** 150,157 ****
      int old=x->x_on_old;
  
!     if(i < 0)
! 	i = 0;
!     if(i >= x->x_number)
! 	i = x->x_number-1;
      if(x->x_on != x->x_on_old)
      {
--- 140,144 ----
      int old=x->x_on_old;
  
!     CLAMP(i,0,x->x_number-1);
      if(x->x_on != x->x_on_old)
      {
***************
*** 174,178 ****
      if (pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class)
      {
! 	if((x->x_change)&&(x->x_on != x->x_on_old))
  	{
              SETFLOAT(x->x_at, (float)x->x_on_old);
--- 161,165 ----
      if (pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class)
      {
! 	if(x->x_change && x->x_on!=x->x_on_old)
  	{
              SETFLOAT(x->x_at, (float)x->x_on_old);
***************
*** 200,208 ****
  {
      int i=(int)f;
! 
!     if(i < 0)
! 	i = 0;
!     if(i >= x->x_number)
! 	i = x->x_number-1;
  
      if (pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class)
--- 187,191 ----
  {
      int i=(int)f;
!     CLAMP(i,0,x->x_number-1);
  
      if (pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class)
***************
*** 241,249 ****
  {
      int i=(int)f;
! 
!     if(i < 0)
! 	i = 0;
!     if(i >= x->x_number)
! 	i = x->x_number-1;
  
      if (pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class)
--- 224,228 ----
  {
      int i=(int)f;
!     CLAMP(i,0,x->x_number-1);
  
      if (pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class)
***************
*** 292,302 ****
      t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
  {
! if (isvert(x)) {
!     int yy = (int)ypos - (int)text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist);
!     hradio_fout(x, (float)(yy / x->x_gui.x_h));
! } else {
!     int xx = (int)xpos - (int)text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist);
!     hradio_fout(x, (float)(xx / x->x_gui.x_w));
! }}
  
  static int hradio_newclick(t_gobj *z, struct _glist *glist,
--- 271,279 ----
      t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
  {
!     int val = isvert(x) ?
! 	((int)ypos - (int)text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist))/x->x_gui.x_h :
! 	((int)xpos - (int)text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist))/x->x_gui.x_h;
!     hradio_fout(x, (float)(val));
! }
  
  static int hradio_newclick(t_gobj *z, struct _glist *glist,
***************
*** 318,332 ****
  {
      int n=(int)num;
! 
!     if(n < 1)
! 	n = 1;
!     if(n > IEM_RADIO_MAX)
! 	n = IEM_RADIO_MAX;
      if(n != x->x_number)
      {
  	(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_ERASE);
  	x->x_number = n;
! 	if(x->x_on >= x->x_number)
! 	    x->x_on = x->x_number - 1;
  	x->x_on_old = x->x_on;
  	(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_NEW);
--- 295,304 ----
  {
      int n=(int)num;
!     CLAMP(n,1,IEM_RADIO_MAX);
      if(n != x->x_number)
      {
  	(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_ERASE);
  	x->x_number = n;
! 	CLAMP(x->x_on,0,x->x_number-1);
  	x->x_on_old = x->x_on;
  	(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_NEW);
***************
*** 341,361 ****
  }
  
- static void hradio_delta(t_hradio *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
- static void hradio_pos(t_hradio *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
- static void hradio_color(t_hradio *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_color((void *)x, &x->x_gui, s, ac, av);}
- static void hradio_send(t_hradio *x, t_symbol *s)
- {iemgui_send(x, &x->x_gui, s);}
- static void hradio_receive(t_hradio *x, t_symbol *s)
- {iemgui_receive(x, &x->x_gui, s);}
- static void hradio_label(t_hradio *x, t_symbol *s)
- {iemgui_label((void *)x, &x->x_gui, s);}
- static void hradio_label_pos(t_hradio *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
- static void hradio_label_font(t_hradio *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
- 
  static void hradio_init(t_hradio *x, t_floatarg f)
  {x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1;}
--- 313,316 ----
***************
*** 367,374 ****
  {
      int bflcol[]={-262144, -1, -1};
!     int a=IEM_GUI_DEFAULTSIZE, on=0, f=0;
      int ldx=0, ldy=-6, chg=1, num=8;
      int fs=8;
-     int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold=IEM_BNG_DEFAULTHOLDFLASHTIME;
      t_symbol *srl[3]={0,0,0};
      int isa,fstyle;
--- 322,328 ----
  {
      int bflcol[]={-262144, -1, -1};
!     int a=IEM_GUI_DEFAULTSIZE, on=0;
      int ldx=0, ldy=-6, chg=1, num=8;
      int fs=8;
      t_symbol *srl[3]={0,0,0};
      int isa,fstyle;
***************
*** 394,402 ****
      else { x->x_gui.x_fsf.x_font_style = 0;
  	strcpy(x->x_gui.x_font, "courier"); }
!     if(num < 1) num = 1;
!     if(num > IEM_RADIO_MAX) num = IEM_RADIO_MAX;
      x->x_number = num;
!     if(on < 0) on = 0;
!     if(on >= x->x_number) on = x->x_number - 1;
      x->x_on = x->x_gui.x_isa.x_loadinit ? on : 0;
      x->x_on_old = x->x_on;
--- 348,354 ----
      else { x->x_gui.x_fsf.x_font_style = 0;
  	strcpy(x->x_gui.x_font, "courier"); }
!     CLAMP(num,1,IEM_RADIO_MAX);
      x->x_number = num;
!     CLAMP(on,0,x->x_number-1);
      x->x_on = x->x_gui.x_isa.x_loadinit ? on : 0;
      x->x_on_old = x->x_on;
***************
*** 413,417 ****
      iemgui_all_colfromload(&x->x_gui, bflcol);
      outlet_new(&x->x_gui.x_obj, &s_list);
!     return (x);
  }
  
--- 365,369 ----
      iemgui_all_colfromload(&x->x_gui, bflcol);
      outlet_new(&x->x_gui.x_obj, &s_list);
!     return x;
  }
  
***************
*** 440,451 ****
      class_addmethod(c, (t_method)hradio_set, gensym("set"), A_FLOAT, 0);
      class_addmethod(c, (t_method)hradio_size, gensym("size"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hradio_delta, gensym("delta"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hradio_pos, gensym("pos"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hradio_color, gensym("color"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hradio_send, gensym("send"), A_DEFSYM, 0);
!     class_addmethod(c, (t_method)hradio_receive, gensym("receive"), A_DEFSYM, 0);
!     class_addmethod(c, (t_method)hradio_label, gensym("label"), A_DEFSYM, 0);
!     class_addmethod(c, (t_method)hradio_label_pos, gensym("label_pos"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hradio_label_font, gensym("label_font"), A_GIMME, 0);
      class_addmethod(c, (t_method)hradio_init, gensym("init"), A_FLOAT, 0);
      class_addmethod(c, (t_method)hradio_number, gensym("number"), A_FLOAT, 0);
--- 392,396 ----
      class_addmethod(c, (t_method)hradio_set, gensym("set"), A_FLOAT, 0);
      class_addmethod(c, (t_method)hradio_size, gensym("size"), A_GIMME, 0);
!     iemgui_register_class(c);
      class_addmethod(c, (t_method)hradio_init, gensym("init"), A_FLOAT, 0);
      class_addmethod(c, (t_method)hradio_number, gensym("number"), A_FLOAT, 0);
***************
*** 460,471 ****
      class_addmethod(o, (t_method)hradio_set, gensym("set"), A_FLOAT, 0);
      class_addmethod(o, (t_method)hradio_size, gensym("size"), A_GIMME, 0);
!     class_addmethod(o, (t_method)hradio_delta, gensym("delta"), A_GIMME, 0);
!     class_addmethod(o, (t_method)hradio_pos, gensym("pos"), A_GIMME, 0);
!     class_addmethod(o, (t_method)hradio_color, gensym("color"), A_GIMME, 0);
!     class_addmethod(o, (t_method)hradio_send, gensym("send"), A_DEFSYM, 0);
!     class_addmethod(o, (t_method)hradio_receive, gensym("receive"), A_DEFSYM, 0);
!     class_addmethod(o, (t_method)hradio_label, gensym("label"), A_DEFSYM, 0);
!     class_addmethod(o, (t_method)hradio_label_pos, gensym("label_pos"), A_GIMME, 0);
!     class_addmethod(o, (t_method)hradio_label_font, gensym("label_font"), A_GIMME, 0);
      class_addmethod(o, (t_method)hradio_init, gensym("init"), A_FLOAT, 0);
      class_addmethod(o, (t_method)hradio_number, gensym("number"), A_FLOAT, 0);
--- 405,409 ----
      class_addmethod(o, (t_method)hradio_set, gensym("set"), A_FLOAT, 0);
      class_addmethod(o, (t_method)hradio_size, gensym("size"), A_GIMME, 0);
!     iemgui_register_class(c);
      class_addmethod(o, (t_method)hradio_init, gensym("init"), A_FLOAT, 0);
      class_addmethod(o, (t_method)hradio_number, gensym("number"), A_FLOAT, 0);

Index: g_io.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_io.c,v
retrieving revision 1.1.1.1.16.2.2.1
retrieving revision 1.1.1.1.16.2.2.2
diff -C2 -d -r1.1.1.1.16.2.2.1 -r1.1.1.1.16.2.2.2
*** g_io.c	6 Mar 2004 22:19:41 -0000	1.1.1.1.16.2.2.1
--- g_io.c	28 Mar 2004 08:21:42 -0000	1.1.1.1.16.2.2.2
***************
*** 148,156 ****
      	while (nshift--) *f1++ = *f2++;
      }
- #if 0
-     if (tot < 5) post("in %x out %x n %x", in, out, n), tot++;
-     if (tot < 5) post("in[0] %f in[1] %f in[2] %f", in[0], in[1], in[2]);
- #endif
- 
      while (n--) *out++ = *in++;
      x->x_fill = out;
--- 148,151 ----

Index: g_all_guis.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_all_guis.c,v
retrieving revision 1.1.1.4.2.4.2.9
retrieving revision 1.1.1.4.2.4.2.10
diff -C2 -d -r1.1.1.4.2.4.2.9 -r1.1.1.4.2.4.2.10
*** g_all_guis.c	28 Mar 2004 07:19:06 -0000	1.1.1.4.2.4.2.9
--- g_all_guis.c	28 Mar 2004 08:21:42 -0000	1.1.1.4.2.4.2.10
***************
*** 697,698 ****
--- 697,723 ----
  	post("sys_mgui: can't send: buffer overflow");
  }
+ 
+ void iemgui2_send(void *x, t_symbol *s)       {iemgui_send(x,(t_iemgui *)x,s);}
+ void iemgui2_receive(void *x, t_symbol *s) {iemgui_receive(x,(t_iemgui *)x,s);}
+ void iemgui2_label(void *x, t_symbol *s)     {iemgui_label(x,(t_iemgui *)x,s);}
+ void iemgui2_label_pos(void *x, t_symbol *s, int ac, t_atom *av)
+ {iemgui_label_pos(x,(t_iemgui *)x, s, ac, av);}
+ void iemgui2_label_font(void *x, t_symbol *s, int ac, t_atom *av)
+ {iemgui_label_font(x,(t_iemgui *)x, s, ac, av);}
+ void iemgui2_delta(void *x, t_symbol *s, int ac, t_atom *av)
+ {iemgui_delta(x,(t_iemgui *)x, s, ac, av);}
+ void iemgui2_pos(void *x, t_symbol *s, int ac, t_atom *av)
+ {iemgui_pos(x,(t_iemgui *)x, s, ac, av);}
+ void iemgui2_color(void *x, t_symbol *s, int ac, t_atom *av)
+ {iemgui_color(x,(t_iemgui *)x, s, ac, av);}
+ 
+ void iemgui_register_class (t_class *c) {
+     class_addmethod(c, (t_method)iemgui2_delta, gensym("delta"), A_GIMME, 0);
+     class_addmethod(c, (t_method)iemgui2_pos, gensym("pos"), A_GIMME, 0);
+     class_addmethod(c, (t_method)iemgui2_color, gensym("color"), A_GIMME, 0);
+     class_addmethod(c, (t_method)iemgui2_send, gensym("send"), A_DEFSYM, 0);
+     class_addmethod(c, (t_method)iemgui2_receive, gensym("receive"), A_DEFSYM, 0);
+     class_addmethod(c, (t_method)iemgui2_label, gensym("label"), A_DEFSYM, 0);
+     class_addmethod(c, (t_method)iemgui2_label_pos, gensym("label_pos"), A_GIMME, 0);
+     class_addmethod(c, (t_method)iemgui2_label_font, gensym("label_font"), A_GIMME, 0);
+ }

Index: g_hslider.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v
retrieving revision 1.1.1.3.2.2.2.8
retrieving revision 1.1.1.3.2.2.2.9
diff -C2 -d -r1.1.1.3.2.2.2.8 -r1.1.1.3.2.2.2.9
*** g_hslider.c	28 Mar 2004 07:21:17 -0000	1.1.1.3.2.2.2.8
--- g_hslider.c	28 Mar 2004 08:21:42 -0000	1.1.1.3.2.2.2.9
***************
*** 23,26 ****
--- 23,28 ----
  #endif
  
+ #define CLAMP(_var,_min,_max) { if (_var<_min) _var=_min; else if (_var>_max) _var=_max; }
+ 
  t_widgetbehavior hslider_widgetbehavior;
  static t_class *hslider_class;
***************
*** 153,160 ****
  	    -----------output-range:----------- %g left: %g right: %g \
  	    %d lin log %d %d empty %d \
! 	    %s %s \
! 	    %s %d %d \
! 	    %d %d \
! 	    %d %d %d\n",
  	    x->x_gui.x_w, IEM_SL_MINSIZE, x->x_gui.x_h, IEM_GUI_MINSIZE,
  	    x->x_min, x->x_max, 0.0,/*no_schedule*/
--- 155,159 ----
  	    -----------output-range:----------- %g left: %g right: %g \
  	    %d lin log %d %d empty %d \
! 	    %s %s %s %d %d %d %d %d %d %d\n",
  	    x->x_gui.x_w, IEM_SL_MINSIZE, x->x_gui.x_h, IEM_GUI_MINSIZE,
  	    x->x_min, x->x_max, 0.0,/*no_schedule*/
***************
*** 170,183 ****
  {
      double g;
!     if(x->x_gui.x_isa.x_reverse)
!     {
! 	if(f > x->x_min) f = x->x_min;
! 	if(f < x->x_max) f = x->x_max;
!     }
!     else
!     {
! 	if(f > x->x_max) f = x->x_max;
! 	if(f < x->x_min) f = x->x_min;
!     }
      g = (x->x_lin0_log1 ? log(f/x->x_min) : (f-x->x_min)) / x->x_k;
      x->x_val = (int)(100.0*g + 0.49999);
--- 169,176 ----
  {
      double g;
!     if(x->x_gui.x_isa.x_reverse) {
! 	CLAMP(f,x->x_max,x->x_min); }
!     else {
! 	CLAMP(f,x->x_min,x->x_max); }
      g = (x->x_lin0_log1 ? log(f/x->x_min) : (f-x->x_min)) / x->x_k;
      x->x_val = (int)(100.0*g + 0.49999);
***************
*** 238,244 ****
  	x->x_pos -= 100*(int)dy;
      x->x_val = x->x_pos;
!     if(x->x_val > (100*x->x_gui.x_h - 100))
      {
! 	x->x_val = 100*x->x_gui.x_h - 100;
  	x->x_pos += 50;
  	x->x_pos -= x->x_pos%100;
--- 231,237 ----
  	x->x_pos -= 100*(int)dy;
      x->x_val = x->x_pos;
!     if(x->x_val > 100*x->x_gui.x_h-100)
      {
! 	x->x_val = 100*x->x_gui.x_h-100;
  	x->x_pos += 50;
  	x->x_pos -= x->x_pos%100;
***************
*** 250,256 ****
  	x->x_pos += 100*(int)dx;
      x->x_val = x->x_pos;
!     if(x->x_val > (100*x->x_gui.x_w - 100))
      {
! 	x->x_val = 100*x->x_gui.x_w - 100;
  	x->x_pos += 50;
  	x->x_pos -= x->x_pos%100;
--- 243,249 ----
  	x->x_pos += 100*(int)dx;
      x->x_val = x->x_pos;
!     if(x->x_val > (100*x->x_gui.x_w-100))
      {
! 	x->x_val = 100*x->x_gui.x_w-100;
  	x->x_pos += 50;
  	x->x_pos -= x->x_pos%100;
***************
*** 273,289 ****
  			  t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
  {
  if (isvert(x)) {
      if(!x->x_steady)
  	x->x_val = (int)(100.0 * (x->x_gui.x_h + text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist) - ypos));
!     if(x->x_val > (100*x->x_gui.x_h - 100))
! 	x->x_val = 100*x->x_gui.x_h - 100;
  }else{
      if(!x->x_steady)
  	x->x_val = (int)(100.0 * (xpos - text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist)));
! if(x->x_val > (100*x->x_gui.x_w - 100))
! 	x->x_val = 100*x->x_gui.x_w - 100;
  }
!     if(x->x_val < 0)
! 	x->x_val = 0;
      x->x_pos = x->x_val;
      (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
--- 266,280 ----
  			  t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
  {
+     int max = isvert(x) ? 100*x->x_gui.x_h-100 : 100*x->x_gui.x_w-100;
  if (isvert(x)) {
      if(!x->x_steady)
  	x->x_val = (int)(100.0 * (x->x_gui.x_h + text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist) - ypos));
!     if(x->x_val > max) x->x_val = max;
  }else{
      if(!x->x_steady)
  	x->x_val = (int)(100.0 * (xpos - text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist)));
!     if(x->x_val > max) x->x_val = max;
  }
!     if(x->x_val < 0) x->x_val = 0;
      x->x_pos = x->x_val;
      (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
***************
*** 324,344 ****
  }
  
- static void hslider_delta(t_hslider *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
- static void hslider_pos(t_hslider *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
- static void hslider_color(t_hslider *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_color((void *)x, &x->x_gui, s, ac, av);}
- static void hslider_send(t_hslider *x, t_symbol *s)
- {iemgui_send(x, &x->x_gui, s);}
- static void hslider_receive(t_hslider *x, t_symbol *s)
- {iemgui_receive(x, &x->x_gui, s);}
- static void hslider_label(t_hslider *x, t_symbol *s)
- {iemgui_label((void *)x, &x->x_gui, s);}
- static void hslider_label_pos(t_hslider *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
- static void hslider_label_font(t_hslider *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
- 
  static void hslider_log(t_hslider *x)
  {
--- 315,318 ----
***************
*** 479,491 ****
      class_addmethod(c, (t_method)hslider_set, gensym("set"), A_FLOAT, 0);
      class_addmethod(c, (t_method)hslider_size, gensym("size"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hslider_delta, gensym("delta"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hslider_pos, gensym("pos"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hslider_range, gensym("range"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hslider_color, gensym("color"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hslider_send, gensym("send"), A_DEFSYM, 0);
!     class_addmethod(c, (t_method)hslider_receive, gensym("receive"), A_DEFSYM, 0);
!     class_addmethod(c, (t_method)hslider_label, gensym("label"), A_DEFSYM, 0);
!     class_addmethod(c, (t_method)hslider_label_pos, gensym("label_pos"), A_GIMME, 0);
!     class_addmethod(c, (t_method)hslider_label_font, gensym("label_font"), A_GIMME, 0);
      class_addmethod(c, (t_method)hslider_log, gensym("log"), 0);
      class_addmethod(c, (t_method)hslider_lin, gensym("lin"), 0);
--- 453,457 ----
      class_addmethod(c, (t_method)hslider_set, gensym("set"), A_FLOAT, 0);
      class_addmethod(c, (t_method)hslider_size, gensym("size"), A_GIMME, 0);
!     iemgui_register_class(c);
      class_addmethod(c, (t_method)hslider_log, gensym("log"), 0);
      class_addmethod(c, (t_method)hslider_lin, gensym("lin"), 0);

Index: g_bang.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v
retrieving revision 1.1.1.3.2.2.2.8
retrieving revision 1.1.1.3.2.2.2.9
diff -C2 -d -r1.1.1.3.2.2.2.8 -r1.1.1.3.2.2.2.9
*** g_bang.c	28 Mar 2004 07:21:15 -0000	1.1.1.3.2.2.2.8
--- g_bang.c	28 Mar 2004 08:21:42 -0000	1.1.1.3.2.2.2.9
***************
*** 27,31 ****
  
  void bng_draw(t_bng *x, t_glist *glist, int mode) {
- t_canvas *canvas=glist_getcanvas(glist);
  if (mode==IEM_GUI_DRAW_MODE_ERASE)
  	sys_mgui((t_iemgui *)x,"bang","erase","");
--- 27,30 ----
***************
*** 195,220 ****
  }
  
- static void bng_delta(t_bng *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
- static void bng_pos(t_bng *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
- static void bng_color(t_bng *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_color((void *)x, &x->x_gui, s, ac, av);}
- static void bng_send(t_bng *x, t_symbol *s)
- {iemgui_send(x, &x->x_gui, s);}
- static void bng_receive(t_bng *x, t_symbol *s)
- {iemgui_receive(x, &x->x_gui, s);}
- static void bng_label(t_bng *x, t_symbol *s)
- {iemgui_label((void *)x, &x->x_gui, s);}
- static void bng_label_pos(t_bng *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
- static void bng_label_font(t_bng *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
- 
  static void bng_init(t_bng *x, t_floatarg f)
! {
!     x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1;
! }
! 
  static void bng_tick_hld(t_bng *x) {x->x_flashed = 0;
      (*x->x_gui.x_draw)(x, x->x_gui.x_glist, 0);}
--- 194,199 ----
  }
  
  static void bng_init(t_bng *x, t_floatarg f)
! {x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1;}
  static void bng_tick_hld(t_bng *x) {x->x_flashed = 0;
      (*x->x_gui.x_draw)(x, x->x_gui.x_glist, 0);}
***************
*** 281,307 ****
  void g_bang_setup(void)
  {
!     bng_class = class_new(gensym("bng"), (t_newmethod)bng_new,
! 			  (t_method)bng_ff, sizeof(t_bng), 0, A_GIMME, 0);
!     class_addbang(bng_class, bng_bang);
!     class_addfloat(bng_class, bng_float);
!     class_addsymbol(bng_class, bng_symbol);
!     class_addpointer(bng_class, bng_pointer);
!     class_addlist(bng_class, bng_list);
!     class_addanything(bng_class, bng_anything);
!     class_addmethod(bng_class, (t_method)bng_click, gensym("click"),
  		    A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
!     class_addmethod(bng_class, (t_method)bng_dialog, gensym("dialog"), A_GIMME, 0);
!     class_addmethod(bng_class, (t_method)bng_loadbang, gensym("loadbang"), 0);
!     class_addmethod(bng_class, (t_method)bng_size, gensym("size"), A_GIMME, 0);
!     class_addmethod(bng_class, (t_method)bng_delta, gensym("delta"), A_GIMME, 0);
!     class_addmethod(bng_class, (t_method)bng_pos, gensym("pos"), A_GIMME, 0);
!     class_addmethod(bng_class, (t_method)bng_flashtime, gensym("flashtime"), A_GIMME, 0);
!     class_addmethod(bng_class, (t_method)bng_color, gensym("color"), A_GIMME, 0);
!     class_addmethod(bng_class, (t_method)bng_send, gensym("send"), A_DEFSYM, 0);
!     class_addmethod(bng_class, (t_method)bng_receive, gensym("receive"), A_DEFSYM, 0);
!     class_addmethod(bng_class, (t_method)bng_label, gensym("label"), A_DEFSYM, 0);
!     class_addmethod(bng_class, (t_method)bng_label_pos, gensym("label_pos"), A_GIMME, 0);
!     class_addmethod(bng_class, (t_method)bng_label_font, gensym("label_font"), A_GIMME, 0);
!     class_addmethod(bng_class, (t_method)bng_init, gensym("init"), A_FLOAT, 0);
      bng_widgetbehavior.w_getrectfn = bng_getrect;
      bng_widgetbehavior.w_displacefn = iemgui_displace;
--- 260,279 ----
  void g_bang_setup(void)
  {
!     t_class *c = bng_class = class_new(gensym("bng"), (t_newmethod)bng_new,
! 	(t_method)bng_ff, sizeof(t_bng), 0, A_GIMME, 0);
!     class_addbang(c, bng_bang);
!     class_addfloat(c, bng_float);
!     class_addsymbol(c, bng_symbol);
!     class_addpointer(c, bng_pointer);
!     class_addlist(c, bng_list);
!     class_addanything(c, bng_anything);
!     class_addmethod(c, (t_method)bng_click, gensym("click"),
  		    A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
!     class_addmethod(c, (t_method)bng_dialog, gensym("dialog"), A_GIMME, 0);
!     class_addmethod(c, (t_method)bng_loadbang, gensym("loadbang"), 0);
!     class_addmethod(c, (t_method)bng_size, gensym("size"), A_GIMME, 0);
!     class_addmethod(c, (t_method)bng_flashtime, gensym("flashtime"), A_GIMME, 0);
!     class_addmethod(c, (t_method)bng_init, gensym("init"), A_FLOAT, 0);
!     iemgui_register_class(c);
      bng_widgetbehavior.w_getrectfn = bng_getrect;
      bng_widgetbehavior.w_displacefn = iemgui_displace;

Index: g_numbox.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v
retrieving revision 1.1.1.4.2.2.2.6
retrieving revision 1.1.1.4.2.2.2.7
diff -C2 -d -r1.1.1.4.2.2.2.6 -r1.1.1.4.2.2.2.7
*** g_numbox.c	28 Mar 2004 07:21:17 -0000	1.1.1.4.2.2.2.6
--- g_numbox.c	28 Mar 2004 08:21:42 -0000	1.1.1.4.2.2.2.7
***************
*** 113,136 ****
  }
  
! void my_numbox_draw(t_my_numbox *x, t_glist *glist, int mode)
! {
!     t_canvas *canvas=glist_getcanvas(glist);
!     switch (mode) {
! 	case IEM_GUI_DRAW_MODE_ERASE: 
! 	    sys_vgui("numbox_erase .x%x.c %x\n",canvas,x); break;
! 	case IEM_GUI_DRAW_MODE_SELECT:
! 	/*    if(x->x_gui.x_fsf.x_selected && x->x_gui.x_fsf.x_change) {
! 		x->x_gui.x_fsf.x_change = 0; CH
! 		clock_unset(x->x_clock_reset);
! 	    }*/
! 	/* fallthru */
! 	default:
! 	    pd_upload((t_gobj *)x);
! 	    my_numbox_ftoa(x);
! 	    sys_vgui("numbox_draw %x .x%x.c\n", x, canvas);
! 	    post("numberbox: %d %d",(int)x->x_gui.x_fsf.x_selected,(int)x->x_gui.x_fsf.x_change);
! 	    sys_vgui("numbox_select %x .x%x.c %d\n", x, canvas,
! 		(int)x->x_gui.x_fsf.x_selected + 2*(int)x->x_gui.x_fsf.x_change); break;
!     }
  }
  
--- 113,127 ----
  }
  
! void my_numbox_draw(t_my_numbox *x, t_glist *glist, int mode) {
! if (mode==IEM_GUI_DRAW_MODE_ERASE)
! 	sys_mgui((t_iemgui *)x,"numbox","erase","");
! else if (mode==IEM_GUI_DRAW_MODE_SELECT)
! 	sys_mgui((t_iemgui *)x,"numbox","select","i",
! 		(int)x->x_gui.x_fsf.x_selected + 2*(int)x->x_gui.x_fsf.x_change);
! else {pd_upload((t_gobj *)x);
! 	my_numbox_ftoa(x);
! 	sys_mgui((t_iemgui *)x,"numbox","draw","");
! 	sys_mgui((t_iemgui *)x,"numbox","select","i",
! 		(int)x->x_gui.x_fsf.x_selected + 2*(int)x->x_gui.x_fsf.x_change);}
  }
  
***************
*** 142,146 ****
  {
      t_my_numbox* x = (t_my_numbox*)z;
- 
      *xp1 = text_xpix(&x->x_gui.x_obj, glist);
      *yp1 = text_ypix(&x->x_gui.x_obj, glist);
--- 133,136 ----
***************
*** 183,187 ****
      if(x->x_lin0_log1)
      {
! 	if((min == 0.0)&&(max == 0.0)) max = 1.0;
  	if(max > 0.0) {
  	    if(min <= 0.0) min = 0.01*max;
--- 173,177 ----
      if(x->x_lin0_log1)
      {
! 	if(min==0.0 && max==0.0) max = 1.0;
  	if(max > 0.0) {
  	    if(min <= 0.0) min = 0.01*max;
***************
*** 333,338 ****
  static void my_numbox_log_height(t_my_numbox *x, t_floatarg lh)
  {
!     if(lh < 10.0)
! 	lh = 10.0;
      x->x_log_height = (int)lh;
      if(x->x_lin0_log1)
--- 323,327 ----
  static void my_numbox_log_height(t_my_numbox *x, t_floatarg lh)
  {
!     if(lh < 10.0) lh = 10.0;
      x->x_log_height = (int)lh;
      if(x->x_lin0_log1)
***************
*** 355,366 ****
  
      w = (int)atom_getintarg(0, ac, av);
!     if(w < 1)
! 	w = 1;
      x->x_gui.x_w = w;
      if(ac > 1)
      {
  	h = (int)atom_getintarg(1, ac, av);
! 	if(h < 8)
! 	    h = 8;
  	x->x_gui.x_h = h;
      }
--- 344,353 ----
  
      w = (int)atom_getintarg(0, ac, av);
!     if(w < 1) w = 1;
      x->x_gui.x_w = w;
      if(ac > 1)
      {
  	h = (int)atom_getintarg(1, ac, av);
! 	if(h < 8) h = 8;
  	x->x_gui.x_h = h;
      }
***************
*** 369,378 ****
  }
  
- static void my_numbox_delta(t_my_numbox *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
- 
- static void my_numbox_pos(t_my_numbox *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
- 
  static void my_numbox_range(t_my_numbox *x, t_symbol *s, int ac, t_atom *av)
  {
--- 356,359 ----
***************
*** 384,418 ****
  }
  
- static void my_numbox_color(t_my_numbox *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_color((void *)x, &x->x_gui, s, ac, av);}
- 
- static void my_numbox_send(t_my_numbox *x, t_symbol *s)
- {iemgui_send(x, &x->x_gui, s);}
- 
- static void my_numbox_receive(t_my_numbox *x, t_symbol *s)
- {iemgui_receive(x, &x->x_gui, s);}
- 
- static void my_numbox_label(t_my_numbox *x, t_symbol *s)
- {iemgui_label((void *)x, &x->x_gui, s);}
- 
- static void my_numbox_label_pos(t_my_numbox *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
- 
- static void my_numbox_label_font(t_my_numbox *x,
-     t_symbol *s, int ac, t_atom *av)
- {
-     int f = (int)atom_getintarg(1, ac, av);
- 
-     if(f < 4)
- 	f = 4;
-     x->x_gui.x_fontsize = f;
-     f = (int)atom_getintarg(0, ac, av);
-     if((f < 0) || (f > 2))
- 	f = 0;
-     x->x_gui.x_fsf.x_font_style = f;
-     my_numbox_calc_fontwidth(x);
-     iemgui_label_font((void *)x, &x->x_gui, s, ac, av);
- }
- 
  static void my_numbox_log(t_my_numbox *x)
  {
--- 365,368 ----
***************
*** 471,476 ****
  	int sl=strlen(x->x_buf)-1;
  
! 	if(sl < 0)
! 	    sl = 0;
  	x->x_buf[sl] = 0;
  	(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
--- 421,425 ----
  	int sl=strlen(x->x_buf)-1;
  
! 	if(sl < 0) sl = 0;
  	x->x_buf[sl] = 0;
  	(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
***************
*** 503,507 ****
      int bflcol[]={-262144, -1, -1};
      int w=5, h=14;
!     int lilo=0, f=0, ldx=0, ldy=-6;
      int fs=10;
      int log_height=256;
--- 452,456 ----
      int bflcol[]={-262144, -1, -1};
      int w=5, h=14;
!     int lilo=0, ldx=0, ldy=-6;
      int fs=10;
      int log_height=256;
***************
*** 524,529 ****
      }
      x->x_gui.x_draw = (t_iemfunptr)my_numbox_draw;
-     x->x_gui.x_fsf.x_snd_able = 1;
-     x->x_gui.x_fsf.x_rcv_able = 1;
      x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
      x->x_val = x->x_gui.x_isa.x_loadinit ? v : 0.0;
--- 473,476 ----
***************
*** 532,537 ****
      if(log_height < 10) log_height = 10;
      x->x_log_height = log_height;
!     if (!strcmp(x->x_gui.x_snd->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0;
!     if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0;
      if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
      else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
--- 479,484 ----
      if(log_height < 10) log_height = 10;
      x->x_log_height = log_height;
!     x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
!     x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
      if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
      else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
***************
*** 586,598 ****
      class_addmethod(c, (t_method)my_numbox_set,      gensym("set"), A_FLOAT, 0);
      class_addmethod(c, (t_method)my_numbox_size,     gensym("size"), A_GIMME, 0);
!     class_addmethod(c, (t_method)my_numbox_delta,    gensym("delta"), A_GIMME, 0);
!     class_addmethod(c, (t_method)my_numbox_pos,      gensym("pos"), A_GIMME, 0);
!     class_addmethod(c, (t_method)my_numbox_range,    gensym("range"), A_GIMME, 0);
!     class_addmethod(c, (t_method)my_numbox_color,    gensym("color"), A_GIMME, 0);
!     class_addmethod(c, (t_method)my_numbox_send,     gensym("send"), A_DEFSYM, 0);
!     class_addmethod(c, (t_method)my_numbox_receive,  gensym("receive"), A_DEFSYM, 0);
!     class_addmethod(c, (t_method)my_numbox_label,    gensym("label"), A_DEFSYM, 0);
!     class_addmethod(c, (t_method)my_numbox_label_pos, gensym("label_pos"), A_GIMME, 0);
!     class_addmethod(c, (t_method)my_numbox_label_font, gensym("label_font"), A_GIMME, 0);
      class_addmethod(c, (t_method)my_numbox_log, gensym("log"), 0);
      class_addmethod(c, (t_method)my_numbox_lin, gensym("lin"), 0);
--- 533,538 ----
      class_addmethod(c, (t_method)my_numbox_set,      gensym("set"), A_FLOAT, 0);
      class_addmethod(c, (t_method)my_numbox_size,     gensym("size"), A_GIMME, 0);
!     /* !@#$ actually overrode label_font to do stuff related to width */
!     iemgui_register_class(c);
      class_addmethod(c, (t_method)my_numbox_log, gensym("log"), 0);
      class_addmethod(c, (t_method)my_numbox_lin, gensym("lin"), 0);





More information about the Pd-cvs mailing list