Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7553
Modified Files:
Tag: impd_0_37
g_all_guis.c g_array.c g_bang.c g_dropper.c g_hdial.c
g_hslider.c g_mycanvas.c g_numbox.c g_toggle.c g_vumeter.c
u_main.tk u_object.tk
Log Message:
changed client-server comm in property dialogs (part 3) (& deleted 400 lines)
Index: g_toggle.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_toggle.c,v
retrieving revision 1.1.1.3.2.2.2.16
retrieving revision 1.1.1.3.2.2.2.17
diff -C2 -d -r1.1.1.3.2.2.2.16 -r1.1.1.3.2.2.2.17
*** g_toggle.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.16
--- g_toggle.c 3 May 2004 17:03:29 -0000 1.1.1.3.2.2.2.17
***************
*** 63,76 ****
}
- static void toggle_properties(t_gobj *z, t_glist *owner)
- {
- t_toggle *x = (t_toggle *)z;
- t_symbol *stub = gfxstub_new((t_pd *)x,x,0);
- pd_upload((t_gobj *)x,owner);
- sys_vgui("pdtk_iemgui_dialog %s dimensions(pix): %d 8 size: 0 0 empty \
- non-zero-value: value: empty 1.0 lin log empty -1 %x\n",
- stub->s_name, x->x_gui.x_w, x);
- }
-
static void toggle_action(t_toggle *x) {
outlet_float(x->x_gui.x_obj.ob_outlet, x->x_on);
--- 63,66 ----
***************
*** 86,104 ****
}
- static void toggle_dialog(t_toggle *x, t_symbol *s, int argc, t_atom *argv)
- {
- t_symbol *srl[3];
- int a = (int)atom_getintarg(0, argc, argv);
- float nonzero = (float)atom_getfloatarg(2, argc, argv);
- if(nonzero == 0.0) nonzero = 1.0;
- x->x_nonzero = nonzero;
- if(x->x_on != 0.0) x->x_on = x->x_nonzero;
- iemgui_dialog(&x->x_gui, srl, argc, argv);
- x->x_gui.x_w = iemgui_clip_size(a);
- x->x_gui.x_h = x->x_gui.x_w;
- x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
- canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
- }
-
static void toggle_set(t_toggle *x, t_floatarg f)
{
--- 76,79 ----
***************
*** 123,161 ****
}
! static void toggle_init(t_toggle *x, t_floatarg f)
! {x->x_gui.x_loadinit = (f==0.0)?0:1;}
! static void toggle_nonzero(t_toggle *x, t_floatarg f)
! {if(f != 0.0) x->x_nonzero = f;}
! static void *toggle_new(t_symbol *s, int argc, t_atom *argv)
{
! t_toggle *x = (t_toggle *)iemgui_new(toggle_class);
! int bflcol[]={-262144, -1, -1};
! int a=IEM_GUI_DEFAULTSIZE;
! int isa=0, fstyle=0, fs=8;
! float on=0.0, nonzero=1.0;
! t_symbol *srl[3]={0,0,0};
! pd_scanargs(argc,argv,"iiaaaiiiiiiii;?",
! &a,&isa,&srl[0],&srl[1],&srl[2],
! &x->x_gui.x_ldx,&x->x_gui.x_ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2],&on);
iem_inttosymargs(&x->x_gui, isa);
! x->x_gui.x_font_style = fstyle;
! iemgui_new_getnames2(&x->x_gui, 2, srl[0], srl[1], srl[2]);
! if((argc == 14)&&IS_A_FLOAT(argv,13))
! nonzero = (float)atom_getfloatarg(13, argc, argv);
! x->x_gui.x_draw = (t_iemfunptr)toggle_draw;
! x->x_gui.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
! iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_font_style);
! x->x_nonzero = (nonzero!=0.0)?nonzero:1.0;
! x->x_on = x->x_gui.x_loadinit ? (on!=0.0)?nonzero:0.0 : 0.0;
! if (x->x_gui.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
! x->x_gui.x_fontsize = MAX(fs,4);
! x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
! iemgui_all_colfromload(&x->x_gui, bflcol);
! iemgui_verify_snd_ne_rcv(&x->x_gui);
! outlet_new(&x->x_gui.x_obj, &s_float);
! return (x);
}
--- 98,135 ----
}
! static void toggle_init(t_toggle *x, t_floatarg f) {x->x_gui.x_loadinit = !!f;}
! static void toggle_nonzero(t_toggle *x, t_floatarg f) {if (f) x->x_nonzero = f;}
! static void toggle_reload(t_toggle *x, int argc, t_atom *argv)
{
! t_iemgui *y = (t_iemgui *)x;
! int isa;
! if (!pd_scanargs(argc,argv,"iiaaaiiiiccci;?",
! &y->x_w,&isa,&y->x_snd,&y->x_rcv,&y->x_lab,
! &x->x_gui.x_ldx,&x->x_gui.x_ldy,&y->x_font_style,&y->x_fontsize,
! &y->x_bcol,&y->x_fcol,&y->x_lcol,&x->x_on)) return;
iem_inttosymargs(&x->x_gui, isa);
! y->x_h = y->x_w;
! x->x_on = y->x_loadinit && x->x_on ? x->x_nonzero : 0.0;
! x->x_nonzero = argc==14 && IS_A_FLOAT(argv,13) ? atom_getfloatarg(13, argc, argv) : 1.0;
! if (!x->x_nonzero) x->x_nonzero=1.0;
! iemgui_constrain(y);
! y->x_snd_able = y->x_snd!=sym_empty;
! y->x_rcv_able = y->x_rcv!=sym_empty;
! if (y->x_rcv_able) pd_bind((t_pd *)x, y->x_rcv);
! }
!
! static void *toggle_new(t_symbol *s, int argc, t_atom *argv)
! {
! t_iemgui *y = iemgui_new(toggle_class);
! t_toggle *x = (t_toggle *)y;
! y->x_draw = (t_iemfunptr)toggle_draw;
! y->x_binbufindex = 2;
! y->x_labelbindex = 2+3;
! x->x_on=0.0;
! outlet_new((t_text *)x, &s_float);
! toggle_reload(x,argc,argv);
! return x;
}
***************
*** 172,184 ****
(t_method)toggle_free, 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_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);
--- 146,156 ----
(t_method)toggle_free, sizeof(t_toggle), 0, A_GIMME, 0);
class_addcreator((t_newmethod)toggle_new, gensym("toggle"), A_GIMME, 0);
+ iemgui_subclass(c);
class_addbang(c, toggle_bang);
class_addfloat(c, toggle_float);
! class_addmethod(c, (t_method)toggle_reload, gensym("reload"), 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);
class_addmethod(c, (t_method)toggle_init, gensym("init"), A_FLOAT, 0);
class_addmethod(c, (t_method)toggle_nonzero, gensym("nonzero"), A_FLOAT, 0);
***************
*** 193,196 ****
class_sethelpsymbol(c, gensym("toggle"));
class_setsavefn(c, toggle_save);
- class_setpropertiesfn(c, toggle_properties);
}
--- 165,167 ----
Index: g_hdial.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v
retrieving revision 1.1.1.4.2.2.2.18
retrieving revision 1.1.1.4.2.2.2.19
diff -C2 -d -r1.1.1.4.2.2.2.18 -r1.1.1.4.2.2.2.19
*** g_hdial.c 3 May 2004 05:37:15 -0000 1.1.1.4.2.2.2.18
--- g_hdial.c 3 May 2004 17:03:28 -0000 1.1.1.4.2.2.2.19
***************
*** 8,11 ****
--- 8,13 ----
/* name change to hradio by MSP (it's a radio button really) and changed to
put out a "float" as in sliders, toggles, etc. */
+ /* name change to just radio by Mathieu Bouchard */
+ /* Copyright 2004 by Mathieu Bouchard */
#include <stdlib.h>
***************
*** 15,24 ****
#include "m_pd.h"
#include "g_canvas.h"
! #include "t_tk.h"
#include "g_all_guis.h"
#include <math.h>
- #define CLAMP(_var,_min,_max) { if (_var<_min) _var=_min; else if (_var>_max) _var=_max; }
-
#define IEM_RADIO_MAX 128
--- 17,24 ----
#include "m_pd.h"
#include "g_canvas.h"
! //#include "t_tk.h"
#include "g_all_guis.h"
#include <math.h>
#define IEM_RADIO_MAX 128
***************
*** 28,36 ****
/* widget helper functions */
! static int isvert(t_hradio *x) {
return x->x_flavor == sym_vdl || x->x_flavor == sym_vradio;
}
! static void hradio_draw(t_hradio *x, t_glist *glist, int mode)
{
if (mode==IEM_GUI_DRAW_MODE_ERASE) {
--- 28,36 ----
/* widget helper functions */
! static int isvert(t_radio *x) {
return x->x_flavor == sym_vdl || x->x_flavor == sym_vradio;
}
! static void radio_draw(t_radio *x, t_glist *glist, int mode)
{
if (mode==IEM_GUI_DRAW_MODE_ERASE) {
***************
*** 47,53 ****
/* ------------------------ hdl widgetbehaviour----------------------------- */
! static void hradio_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2)
{
! t_hradio *x = (t_hradio *)z;
*xp1 = text_xpix((t_text *)x, glist);
*yp1 = text_ypix((t_text *)x, glist);
--- 47,53 ----
/* ------------------------ hdl widgetbehaviour----------------------------- */
! static void radio_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2)
{
! t_radio *x = (t_radio *)z;
*xp1 = text_xpix((t_text *)x, glist);
*yp1 = text_ypix((t_text *)x, glist);
***************
*** 56,62 ****
}
! static void hradio_save(t_gobj *z, t_binbuf *b)
{
! t_hradio *x = (t_hradio *)z;
int bflcol[3];
t_symbol *srl[3];
--- 56,62 ----
}
! static void radio_save(t_gobj *z, t_binbuf *b)
{
! t_radio *x = (t_radio *)z;
int bflcol[3];
t_symbol *srl[3];
***************
*** 73,108 ****
}
! static void hradio_properties(t_gobj *z, t_glist *owner)
! {
! t_hradio *x = (t_hradio *)z;
! t_symbol *stub = gfxstub_new((t_pd *)x,x,0);
! pd_upload((t_gobj *)x,owner);
! sys_vgui("pdtk_iemgui_dialog %s dimensions(pix): %d 8 size: 0 0 empty \
! empty empty empty 0 new-only new&old number: %d %x\n",
! stub->s_name, x->x_gui.x_w, x->x_number, x);
! }
!
! static void hradio_dialog(t_hradio *x, t_symbol *s, int argc, t_atom *argv)
! {
! t_symbol *srl[3];
! int a = (int)atom_getintarg(0, argc, argv);
! int chg = (int)atom_getintarg(4, argc, argv);
! int num = (int)atom_getintarg(6, argc, argv);
! x->x_change = !!chg;
! iemgui_dialog(&x->x_gui, srl, argc, argv);
! x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
! if(x->x_number != num) {
! x->x_gui.x_draw(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_ERASE);
! x->x_number = num;
! 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, 0);
! canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
! }
!
! static void hradio_set(t_hradio *x, t_floatarg f)
{
int i=(int)f;
--- 73,77 ----
}
! static void radio_set(t_radio *x, t_floatarg f)
{
int i=(int)f;
***************
*** 120,124 ****
}
! static void hradio_bang(t_hradio *x)
{
/* compatibility with earlier "hdial" behavior */
--- 89,93 ----
}
! static void radio_bang(t_radio *x)
{
/* compatibility with earlier "hdial" behavior */
***************
*** 148,152 ****
}
! static void hradio_fout(t_hradio *x, t_floatarg f)
{
int i=(int)f;
--- 117,121 ----
}
! static void radio_fout(t_radio *x, t_floatarg f)
{
int i=(int)f;
***************
*** 184,188 ****
}
! static void hradio_float(t_hradio *x, t_floatarg f)
{
int i=(int)f;
--- 153,157 ----
}
! static void radio_float(t_radio *x, t_floatarg f)
{
int i=(int)f;
***************
*** 226,233 ****
}
! static void hradio_loadbang(t_hradio *x)
! {if(!sys_noloadbang && x->x_gui.x_loadinit) hradio_bang(x);}
! static void hradio_number(t_hradio *x, t_floatarg num)
{
int n=(int)num;
--- 195,202 ----
}
! static void radio_loadbang(t_radio *x)
! {if(!sys_noloadbang && x->x_gui.x_loadinit) radio_bang(x);}
! static void radio_number(t_radio *x, t_floatarg num)
{
int n=(int)num;
***************
*** 242,246 ****
}
! static void hradio_size(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{
x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
--- 211,215 ----
}
! static void radio_size(t_radio *x, t_symbol *s, int ac, t_atom *av)
{
x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
***************
*** 248,298 ****
}
! static void hradio_init(t_hradio *x, t_floatarg f)
{x->x_gui.x_loadinit = (f==0.0)?0:1;}
! static void hradio_double_change(t_hradio *x) {x->x_change = 1;}
! static void hradio_single_change(t_hradio *x) {x->x_change = 0;}
! static void *hradio_new(t_symbol *s, int argc, t_atom *argv)
{
! t_hradio *x = (t_hradio *)iemgui_new(radio_class);
! int bflcol[]={-262144, -1, -1};
! int a=IEM_GUI_DEFAULTSIZE, on=0;
! int chg=1, num=8;
! int fs=8;
! t_symbol *srl[3]={0,0,0};
! int isa,fstyle;
! x->x_flavor = s;
! fprintf(stderr,"flavour = %s\n",x->x_flavor->s_name);
! if(pd_scanargs(argc,argv,"iiiiaaaiiiiiiii",
! &a,&chg,&isa,&num,&srl[0],&srl[1],&srl[2],
! &x->x_gui.x_ldx,&x->x_gui.x_ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2],&on))
! {
! iem_inttosymargs(&x->x_gui, isa);
! iemgui_new_getnames2(&x->x_gui, 4, srl[0], srl[1], srl[2]);
! }
! else iemgui_new_getnames(&x->x_gui, 4, 0);
! x->x_gui.x_font_style = fstyle;
! x->x_gui.x_draw = (t_iemfunptr)hradio_draw;
! x->x_gui.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
! iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_font_style);
! CLAMP(num,1,IEM_RADIO_MAX);
! x->x_number = num;
! CLAMP(on,0,x->x_number-1);
! x->x_on = x->x_gui.x_loadinit ? on : 0;
! x->x_on_old = x->x_on;
! x->x_change = !! chg;
! if (x->x_gui.x_rcv_able) pd_bind((t_pd *)x, x->x_gui.x_rcv);
! x->x_gui.x_fontsize = MAX(fs,4);
! x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
! iemgui_verify_snd_ne_rcv(&x->x_gui);
! iemgui_all_colfromload(&x->x_gui, bflcol);
! outlet_new(&x->x_gui.x_obj, &s_list);
return x;
}
! static void hradio_ff(t_hradio *x)
{
if(x->x_gui.x_rcv_able) pd_unbind((t_pd *)x, x->x_gui.x_rcv);
--- 217,261 ----
}
! static void radio_init(t_radio *x, t_floatarg f)
{x->x_gui.x_loadinit = (f==0.0)?0:1;}
! static void radio_double_change(t_radio *x) {x->x_change = 1;}
! static void radio_single_change(t_radio *x) {x->x_change = 0;}
! static void radio_reload(t_radio *x, int argc, t_atom *argv)
{
! t_iemgui *y = (t_iemgui *)x;
! int isa=0;
! if(!pd_scanargs(argc,argv,"ibiiaaaiiiiccci",
! &y->x_w,&x->x_change,&isa,&x->x_number,&y->x_snd,&y->x_rcv,&y->x_lab,
! &y->x_ldx,&y->x_ldy,&y->x_font_style,&y->x_fontsize,
! &y->x_bcol,&y->x_fcol,&y->x_lcol,&x->x_on)) return;
! iem_inttosymargs(&x->x_gui, isa);
! iemgui_constrain(y);
! y->x_snd_able = y->x_snd!=sym_empty;
! y->x_rcv_able = y->x_rcv!=sym_empty;
! if (y->x_rcv_able) pd_bind((t_pd *)x, y->x_rcv);
! }
! static void *radio_new(t_symbol *s, int argc, t_atom *argv)
! {
! t_iemgui *y = iemgui_new(radio_class);
! t_radio *x = (t_radio *)y;
! x->x_on_old=x->x_on=0;
! x->x_number=8;
! x->x_change=1;
! x->x_flavor=s;
! y->x_binbufindex = 4;
! y->x_labelbindex = 4+3;
! y->x_draw = (t_iemfunptr)radio_draw;
! CLAMP(x->x_number,1,IEM_RADIO_MAX);
! CLAMP(x->x_on,0,x->x_number-1);
! x->x_on_old = x->x_on = y->x_loadinit ? x->x_on : 0;
! outlet_new(&y->x_obj, &s_list);
! radio_reload(x,argc,argv);
return x;
}
! static void radio_ff(t_radio *x)
{
if(x->x_gui.x_rcv_able) pd_unbind((t_pd *)x, x->x_gui.x_rcv);
***************
*** 301,323 ****
static t_widgetbehavior wb;
! void g_hradio_setup(void)
{
! t_class *c = radio_class = class_new(gensym("radio"), (t_newmethod)hradio_new,
! (t_method)hradio_ff, sizeof(t_hradio), 0, A_GIMME, 0);
!
! class_addbang(c, hradio_bang);
! class_addfloat(c, hradio_float);
! class_addmethod(c, (t_method)hradio_dialog, gensym("dialog"), A_GIMME, 0);
! class_addmethod(c, (t_method)hradio_loadbang, gensym("loadbang"), 0);
! 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_init, gensym("init"), A_FLOAT, 0);
! class_addmethod(c, (t_method)hradio_fout, gensym("fout"), A_FLOAT, 0);
! class_addmethod(c, (t_method)hradio_number, gensym("number"), A_FLOAT, 0);
! class_addmethod(c, (t_method)hradio_single_change, gensym("single_change"), 0);
! class_addmethod(c, (t_method)hradio_double_change, gensym("double_change"), 0);
! iemgui_register_class(c);
! wb.w_getrectfn = hradio_getrect;
wb.w_displacefn = iemgui_displace;
wb.w_selectfn = iemgui_select;
--- 264,285 ----
static t_widgetbehavior wb;
! void g_radio_setup(void)
{
! t_class *c = radio_class = class_new(gensym("radio"), (t_newmethod)radio_new,
! (t_method)radio_ff, sizeof(t_radio), 0, A_GIMME, 0);
! iemgui_subclass(c);
! class_addbang(c, radio_bang);
! class_addfloat(c, radio_float);
! class_addmethod(c, (t_method)radio_reload, gensym("reload"), A_GIMME, 0);
! class_addmethod(c, (t_method)radio_loadbang, gensym("loadbang"), 0);
! class_addmethod(c, (t_method)radio_set, gensym("set"), A_FLOAT, 0);
! class_addmethod(c, (t_method)radio_size, gensym("size"), A_GIMME, 0);
! class_addmethod(c, (t_method)radio_init, gensym("init"), A_FLOAT, 0);
! class_addmethod(c, (t_method)radio_fout, gensym("fout"), A_FLOAT, 0);
! class_addmethod(c, (t_method)radio_number, gensym("number"), A_FLOAT, 0);
! class_addmethod(c, (t_method)radio_single_change, gensym("single_change"), 0);
! class_addmethod(c, (t_method)radio_double_change, gensym("double_change"), 0);
! wb.w_getrectfn = radio_getrect;
wb.w_displacefn = iemgui_displace;
wb.w_selectfn = iemgui_select;
***************
*** 325,329 ****
wb.w_deletefn = iemgui_delete;
wb.w_visfn = iemgui_vis;
! wb.w_clickfn = 0 /*hradio_newclick*/;
sym_hdl = gensym("hdl");
--- 287,291 ----
wb.w_deletefn = iemgui_delete;
wb.w_visfn = iemgui_vis;
! wb.w_clickfn = 0 /*radio_newclick*/;
sym_hdl = gensym("hdl");
***************
*** 333,346 ****
class_setwidget(c, &wb);
class_sethelpsymbol(c, gensym("hradio"));
! class_setsavefn(c, hradio_save);
! class_setpropertiesfn(c, hradio_properties);
! class_addcreator((t_newmethod)hradio_new, gensym("hradio"), A_GIMME, 0);
! class_addcreator((t_newmethod)hradio_new, gensym("vradio"), A_GIMME, 0);
! class_addcreator((t_newmethod)hradio_new, gensym("hdl"), A_GIMME, 0);
! class_addcreator((t_newmethod)hradio_new, gensym("vdl"), A_GIMME, 0);
! class_addcreator((t_newmethod)hradio_new, gensym("rdb"), A_GIMME, 0);
! class_addcreator((t_newmethod)hradio_new, gensym("radiobut"), A_GIMME, 0);
! class_addcreator((t_newmethod)hradio_new, gensym("radiobutton"), A_GIMME, 0);
}
-
- void g_vradio_setup(void) {}
--- 295,305 ----
class_setwidget(c, &wb);
class_sethelpsymbol(c, gensym("hradio"));
! class_setsavefn(c, radio_save);
! class_addcreator((t_newmethod)radio_new, gensym("hradio"), A_GIMME, 0);
! class_addcreator((t_newmethod)radio_new, gensym("vradio"), A_GIMME, 0);
! class_addcreator((t_newmethod)radio_new, gensym("hdl"), A_GIMME, 0);
! class_addcreator((t_newmethod)radio_new, gensym("vdl"), A_GIMME, 0);
! class_addcreator((t_newmethod)radio_new, gensym("rdb"), A_GIMME, 0);
! class_addcreator((t_newmethod)radio_new, gensym("radiobut"), A_GIMME, 0);
! class_addcreator((t_newmethod)radio_new, gensym("radiobutton"), A_GIMME, 0);
}
Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.1.1.4.2.7.4.57
retrieving revision 1.1.1.4.2.7.4.58
diff -C2 -d -r1.1.1.4.2.7.4.57 -r1.1.1.4.2.7.4.58
*** u_main.tk 3 May 2004 05:37:13 -0000 1.1.1.4.2.7.4.57
--- u_main.tk 3 May 2004 17:03:29 -0000 1.1.1.4.2.7.4.58
***************
*** 1299,1302 ****
--- 1299,1306 ----
pack $f -side top
}
+ section {
+ label $f -text $label -bg "#0000aa" -fg "#ffff55" -font {helvetica -10 bold}
+ pack $f -side top -fill x
+ }
default {
frame $f
***************
*** 1530,1535 ****
global _
set self [string trimleft $id .]
! if {$_($self:w) < $_($self:min_w)} {set _($self:w) $_($self:min_w)}
! if {$_($self:h) < $_($self:min_h)} {set _($self:h) $_($self:min_h)}
}
--- 1534,1539 ----
global _
set self [string trimleft $id .]
! # if {$_($self:w) < $_($self:min_w)} {set _($self:w) $_($self:min_w)}
! # if {$_($self:h) < $_($self:min_h)} {set _($self:h) $_($self:min_h)}
}
***************
*** 1537,1542 ****
global _
set self [string trimleft $id .]
! if {$_($self:num) > 2000} {set _($self:num) 2000}
! if {$_($self:num) < 1} {set _($self:num) 1}
}
--- 1541,1546 ----
global _
set self [string trimleft $id .]
! if {$_($self:n) > 2000} {set _($self:n) 2000}
! if {$_($self:n) < 1} {set _($self:n) 1}
}
***************
*** 1584,1593 ****
global _
set self [string trimleft $id .]
! iemgui_clip_dim $id
#!!! iemgui_clip_num $id
! iemgui_sched_rng $id
! iemgui_verify_rng $id
! iemgui_sched_rng $id
! iemgui_clip_fontsize $id
if {$_($self:snd) == ""} {set snd "empty"} {set snd $_($self:snd)}
if {$_($self:rcv) == ""} {set rcv "empty"} {set rcv $_($self:rcv)}
--- 1588,1597 ----
global _
set self [string trimleft $id .]
! #!!! iemgui_clip_dim $id
#!!! iemgui_clip_num $id
! #!!! iemgui_sched_rng $id
! #!!! iemgui_verify_rng $id
! #!!! iemgui_sched_rng $id
! #!!! iemgui_clip_fontsize $id
if {$_($self:snd) == ""} {set snd "empty"} {set snd $_($self:snd)}
if {$_($self:rcv) == ""} {set rcv "empty"} {set rcv $_($self:rcv)}
***************
*** 1596,1636 ****
if {[string index $rcv 0] == "$"} { set rcv [string replace $rcv 0 0 #] }
if {[string index $lab 0] == "$"} { set lab [string replace $lab 0 0 #] }
pd "$id dialog \
! $_($self:w) $_($self:h) \
! $_($self:min) $_($self:max) \
! $_($self:is_log) $_($self:loadbang) \
! $_($self:num) $snd $rcv $lab \
! $_($self:ldx) $_($self:ldy) \
! $_($self:fstyle) $_($self:fs) \
! $_($self:bcol) $_($self:fcol) $_($self:lcol) \
! $_($self:steady) ;"
}
proc iemgui_cancel {id} {pd "$id cancel ;"}
proc iemgui_ok {id} {iemgui_apply $id; iemgui_cancel $id}
! set properties(iemgui) {
! }
! proc pdtk_iemgui_dialog {id dim_header w min_w w_label h min_h h_label \
! rng_header min_label max_label rng_sched lilo0_label lilo1_label num_label num obj} {
! global _ classinfo
set self [string trimleft $id .]
- set _($self:w) $w; set _($self:min_w) $min_w
- set _($self:h) $h; set _($self:min_h) $min_h
- set _($self:rng_sch) $rng_sched
- set _($self:lilo0) $lilo0_label
- set _($self:lilo1) $lilo1_label
- set _($self:num) $num
# x->x_flashtime_break, x->x_flashtime_hold
foreach var {snd rcv lab} {
! set val nosndno
! catch {set val $_($obj:$var); switch -- $val { empty {set val ""}}}
! set _($self:$var) $val
}
! foreach var {ldx ldy fstyle fs} {
! set _($self:$var) $_($obj:$var)
}
! foreach var {bcol fcol lcol is_log steady min max} {
! set _($self:$var) -1
catch {set _($self:$var) [parse_color $_($obj:$var)]}
}
--- 1600,1629 ----
if {[string index $rcv 0] == "$"} { set rcv [string replace $rcv 0 0 #] }
if {[string index $lab 0] == "$"} { set lab [string replace $lab 0 0 #] }
+ pd "$id send $snd ;"
+ pd "$id receive $rcv ;"
+ pd "$id label $lab ;"
+ pd "$id label_pos $_($self:ldx) $_($self:ldy) ;"
+ pd "$id label_font $_($self:fstyle) $_($self:fs) ;"
+ pd "$id color $_($self:bcol) $_($self:fcol) $_($self:lcol) ;"
pd "$id dialog \
! $_($self:w) $_($self:h) $_($self:min) $_($self:max) \
! $_($self:is_log) $_($self:loadbang) $_($self:num) $_($self:steady) ;"
}
proc iemgui_cancel {id} {pd "$id cancel ;"}
proc iemgui_ok {id} {iemgui_apply $id; iemgui_cancel $id}
! set properties(iemgui) {}
! proc pdtk_iemgui_dialog {id obj} {
! global _ classinfo fields
set self [string trimleft $id .]
# x->x_flashtime_break, x->x_flashtime_hold
foreach var {snd rcv lab} {
! catch {set val $_($obj:$var); switch -- $val { empty {set val ""}}; set _($self:$var) $val}
}
! foreach var {w h hold break ldx ldy fstyle fs is_log steady min max} {
! catch {set _($self:$var) $_($obj:$var)}
}
! foreach var {bcol fcol lcol} {
catch {set _($self:$var) [parse_color $_($obj:$var)]}
}
***************
*** 1642,1673 ****
set props {}
! #$dim_header
! lappend props w "${w_label}(px): " entry {-width 7}
! if {$h_label != "empty"} {
! lappend props h "${h_label}(px): " entry {-width 7}
! }
! #$rng_header
! if {$rng_header != "empty"} {
! if {$min_label != "empty"} {
! lappend props min "${min_label}: " entry {-width 9}
! }
! if {$max_label != "empty"} {
! lappend props max "${max_label}: " entry {-width 9}
! }
! }
! if {$_($self:is_log) >= 0} {
! lappend props is_log [list "Mode: " $lilo0_label $lilo1_label] choice {}
! }
! if {$_($self:loadbang) >= 0} {lappend props loadbang "init" toggle {}}
! if {$_($self:num) > 0} {lappend props num $num_label entry {-width 4}}
! if {$_($self:steady) >= 0} {
! lappend props steady [list "Steadiness: " "jump on click" "steady on click"] choice {}
! }
properties_dialog $self .$self iemgui_ok $props
set props {}
! if {$_($self:snd) != "nosndno"} {lappend props snd "send-symbol: " entry {-width 20}}
! if {$_($self:rcv) != "norcvno"} {lappend props rcv "receive-symbol: " entry {-width 20}}
lappend props lab "label: " entry {-width 29}
lappend props ldx "label x offset: " entry {-width 5}
--- 1635,1655 ----
set props {}
! set fi $fields($_($obj:class))
! if {[lsearch $fi w]>=0} {lappend props w "width(px): " entry {-width 7}}
! if {[lsearch $fi h]>=0} {lappend props h "height(px): " entry {-width 7}}
! if {[lsearch $fi hold]>=0} {lappend props hold "hold time(ms): " entry {-width 9}}
! if {[lsearch $fi break]>=0} {lappend props break "break time(ms): " entry {-width 9}}
! if {[lsearch $fi min]>=0} {lappend props min "minimum value: " entry {-width 9}}
! if {[lsearch $fi max]>=0} {lappend props max "maximum value: " entry {-width 9}}
! if {[lsearch $fi is_log]>=0} {lappend props is_log [list "Mode: " "linear" "logarithmic"] choice {}}
! if {[lsearch $fi isa]>=0} {lappend props loadbang "init" toggle {}}
! if {[lsearch $fi n]>=0} {lappend props n "n: " entry {-width 4}}
! if {[lsearch $fi steady]>=0} {lappend props steady [list "Steadiness: " "jump on click" "steady on click"] choice {}}
properties_dialog $self .$self iemgui_ok $props
set props {}
! if {[lsearch $fi snd]>=0} {lappend props snd "send-symbol: " entry {-width 20}}
! if {[lsearch $fi rcv]>=0} {lappend props rcv "receive-symbol: " entry {-width 20}}
lappend props lab "label: " entry {-width 29}
lappend props ldx "label x offset: " entry {-width 5}
***************
*** 1676,1680 ****
lappend props fs "font size: " entry {-width 5}
lappend props bcol "background color: " color {}
! lappend props fcol "foreground color: " color {}
lappend props lcol "label color: " color {}
properties_dialog $self .$self iemgui_ok $props
--- 1658,1662 ----
lappend props fs "font size: " entry {-width 5}
lappend props bcol "background color: " color {}
! if {[lsearch $fi fcol]>=0} {lappend props fcol "foreground color: " color {}}
lappend props lcol "label color: " color {}
properties_dialog $self .$self iemgui_ok $props
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.23
retrieving revision 1.1.1.4.2.4.2.24
diff -C2 -d -r1.1.1.4.2.4.2.23 -r1.1.1.4.2.4.2.24
*** g_all_guis.c 3 May 2004 04:34:30 -0000 1.1.1.4.2.4.2.23
--- g_all_guis.c 3 May 2004 17:03:28 -0000 1.1.1.4.2.4.2.24
***************
*** 28,32 ****
#define IEM_FONT_MINSIZE 4
! /* #define GGEE_HSLIDER_COMPATIBLE */
/*------------------ global varaibles -------------------------*/
--- 28,32 ----
#define IEM_FONT_MINSIZE 4
! t_symbol *sym_empty;
/*------------------ global varaibles -------------------------*/
***************
*** 44,57 ****
/*------------------ global functions -------------------------*/
! void iemgui_set_font_style(t_iemgui *self, int f) {
! if(f == 1) strcpy(self->x_font, "helvetica");
! else if(f == 2) strcpy(self->x_font, "times");
! else {
! f = 0;
! strcpy(self->x_font, "courier");
! }
! self->x_font_style = f;
}
!
int iemgui_clip_size(int size) {return MAX(8,size);}
int iemgui_clip_font(int size) {return MAX(size,IEM_FONT_MINSIZE);}
--- 44,55 ----
/*------------------ global functions -------------------------*/
! const char *iemgui_get_font(t_iemgui *self) {
! int i = self->x_font_style;
! if (i==0) return "helvetica";
! if (i==1) return "times";
! if (i==2) return "courier";
! return 0;
}
!
int iemgui_clip_size(int size) {return MAX(8,size);}
int iemgui_clip_font(int size) {return MAX(size,IEM_FONT_MINSIZE);}
***************
*** 99,126 ****
}
- void iemgui_new_getnames(t_iemgui *iemgui, int indx, t_atom *argv)
- {
- if (argv)
- {
- iemgui->x_snd = iemgui_new_dogetname(iemgui, indx, argv);
- iemgui->x_rcv = iemgui_new_dogetname(iemgui, indx+1, argv);
- iemgui->x_lab = iemgui_new_dogetname(iemgui, indx+2, argv);
- }
- else iemgui->x_snd = iemgui->x_rcv = iemgui->x_lab = gensym("empty");
- iemgui->x_snd_unexpanded = iemgui->x_rcv_unexpanded =
- iemgui->x_lab_unexpanded = 0;
- iemgui->x_binbufindex = indx;
- iemgui->x_labelbindex = indx + 3;
- }
-
- void iemgui_new_getnames2(t_iemgui *iemgui, int i, t_symbol *snd, t_symbol *rcv, t_symbol *lab)
- {
- iemgui->x_snd = snd?snd:gensym("empty"); iemgui->x_snd_unexpanded = 0;
- iemgui->x_rcv = rcv?rcv:gensym("empty"); iemgui->x_rcv_unexpanded = 0;
- iemgui->x_lab = lab?lab:gensym("empty"); iemgui->x_lab_unexpanded = 0;
- iemgui->x_binbufindex = i;
- iemgui->x_labelbindex = i+3;
- }
-
/* convert symbols in "$" form to the expanded symbols */
static void iemgui_all_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym)
--- 97,100 ----
***************
*** 184,194 ****
}
- void iemgui_all_colfromload(t_iemgui *iemgui, int *bflcol)
- {
- iemgui->x_bcol = convert_color(bflcol[0]);
- iemgui->x_fcol = convert_color(bflcol[1]);
- iemgui->x_lcol = convert_color(bflcol[2]);
- }
-
static void iemgui_all_raute2dollar(t_symbol **srlsym)
{
--- 158,161 ----
***************
*** 248,255 ****
iemgui->x_ldy = (int)atom_getintarg(1, ac, av);
if(glist_isvisible(iemgui->x_glist))
! sys_vgui(".x%x.c coords %xLABEL %d %d\n",
! glist_getcanvas(iemgui->x_glist), iemgui,
! iemgui->x_obj.te_xpix+iemgui->x_ldx,
! iemgui->x_obj.te_ypix+iemgui->x_ldy);
}
--- 215,219 ----
iemgui->x_ldy = (int)atom_getintarg(1, ac, av);
if(glist_isvisible(iemgui->x_glist))
! iemgui->x_draw(iemgui, iemgui->x_glist, 0);
}
***************
*** 258,265 ****
int f = MAX(4,(int)atom_getintarg(1, ac, av));
iemgui->x_fontsize = f;
! iemgui_set_font_style(iemgui, (int)atom_getintarg(0, ac, av));
! if(glist_isvisible(iemgui->x_glist))
! sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold}\n",
! glist_getcanvas(iemgui->x_glist), iemgui, iemgui->x_font, iemgui->x_fontsize);
}
--- 222,227 ----
int f = MAX(4,(int)atom_getintarg(1, ac, av));
iemgui->x_fontsize = f;
! iemgui->x_font_style = atom_getintarg(0, ac, av);
! if(glist_isvisible(iemgui->x_glist)) iemgui->x_draw(iemgui, iemgui->x_glist, 0);
}
***************
*** 356,374 ****
}
int iemgui_dialog(t_iemgui *iemgui, t_symbol **srl, int argc, t_atom *argv)
{
- int init,ldx,ldy,f,fs,bcol,fcol,lcol;
- int sndable, rcvable;
- pd_scanargs(argc,argv,"?????i?aaaiiiiiii;",
- &init,&srl[0],&srl[1],&srl[2],&ldx,&ldy,&f,&fs,&bcol,&fcol,&lcol);
- iemgui->x_loadinit = !!init;
- sndable = !!strcmp(srl[0]->s_name, "empty");
- rcvable = !!strcmp(srl[1]->s_name, "empty");
iemgui_all_raute2dollar(srl);
iemgui_all_dollararg2sym(iemgui, srl);
! if(rcvable)
! {
! if(strcmp(srl[1]->s_name, iemgui->x_rcv->s_name))
! {
if(iemgui->x_rcv_able) pd_unbind((t_pd *)iemgui, iemgui->x_rcv);
iemgui->x_rcv = srl[1];
--- 318,328 ----
}
+ /*
int iemgui_dialog(t_iemgui *iemgui, t_symbol **srl, int argc, t_atom *argv)
{
iemgui_all_raute2dollar(srl);
iemgui_all_dollararg2sym(iemgui, srl);
! if(rcvable) {
! if(strcmp(srl[1]->s_name, iemgui->x_rcv->s_name)) {
if(iemgui->x_rcv_able) pd_unbind((t_pd *)iemgui, iemgui->x_rcv);
iemgui->x_rcv = srl[1];
***************
*** 376,399 ****
}
}
! else if(!rcvable && iemgui->x_rcv_able)
! {
pd_unbind((t_pd *)iemgui, iemgui->x_rcv);
iemgui->x_rcv = srl[1];
}
iemgui->x_snd = srl[0];
- iemgui->x_snd_able = sndable;
- iemgui->x_rcv_able = rcvable;
- iemgui->x_lcol = lcol & 0xffffff;
- iemgui->x_fcol = fcol & 0xffffff;
- iemgui->x_bcol = bcol & 0xffffff;
iemgui->x_lab = srl[2];
- iemgui->x_ldx = ldx;
- iemgui->x_ldy = ldy;
- iemgui_set_font_style(iemgui, f);
- if (fs<4) fs=4;
- iemgui->x_fontsize = fs;
- iemgui_verify_snd_ne_rcv(iemgui);
return 0;
}
void iem_inttosymargs(t_iemgui *self, int n)
--- 330,342 ----
}
}
! else if(!rcvable && iemgui->x_rcv_able) {
pd_unbind((t_pd *)iemgui, iemgui->x_rcv);
iemgui->x_rcv = srl[1];
}
iemgui->x_snd = srl[0];
iemgui->x_lab = srl[2];
return 0;
}
+ */
void iem_inttosymargs(t_iemgui *self, int n)
***************
*** 421,425 ****
case 0 : goto err; /* too many args */
case '*': goto break1; /* rest is any type */
! case 'F': case 'f': case 'd': case 'i': if (!IS_A_FLOAT(argv,i)) goto err;
break;
case 'S': case 's': if (!IS_A_SYMBOL(argv,i)) goto err;
--- 364,368 ----
case 0 : goto err; /* too many args */
case '*': goto break1; /* rest is any type */
! case 'F': case 'f': case 'd': case 'i': case 'c': case 'b': if (!IS_A_FLOAT(argv,i)) goto err;
break;
case 'S': case 's': if (!IS_A_SYMBOL(argv,i)) goto err;
***************
*** 452,455 ****
--- 395,406 ----
/*fprintf(stderr," getting int*=0x%08x, *=%d\n",p,*p);*/
} break;
+ case 'c': { /* colour, from IEM format to RGB 8:8:8 format */
+ int *p = va_arg(val, int*);
+ *p = convert_color(atom_getintarg(i,argc,argv));
+ } break;
+ case 'b': { /* 0 or 1 */
+ int *p = va_arg(val, int*);
+ *p = !!atom_getintarg(i,argc,argv);
+ } break;
case 's': {
t_symbol **p = va_arg(val,t_symbol**);
***************
*** 542,546 ****
}
! void iemgui_register_class (t_class *c) {
class_addmethod(c, (t_method)iemgui_delta, gensym("delta"), A_GIMME, 0);
class_addmethod(c, (t_method)iemgui_pos, gensym("pos"), A_GIMME, 0);
--- 493,498 ----
}
! void iemgui_subclass (t_class *c) {
! sym_empty = gensym("empty");
class_addmethod(c, (t_method)iemgui_delta, gensym("delta"), A_GIMME, 0);
class_addmethod(c, (t_method)iemgui_pos, gensym("pos"), A_GIMME, 0);
***************
*** 551,570 ****
class_addmethod(c, (t_method)iemgui_label_pos, gensym("label_pos"), A_GIMME, 0);
class_addmethod(c, (t_method)iemgui_label_font, gensym("label_font"), A_GIMME, 0);
}
EXTERN t_iemgui *iemgui_new(t_class *qlass) {
! t_iemgui *self = (t_iemgui *)pd_new(qlass);
! self->x_glist = (t_glist *)canvas_getcurrent();
! self->x_ldx=0;
! self->x_ldy=-6;
! iem_inttosymargs(self,0);
! self->x_font_style = 0;
! self->x_selected = 0;
! self->x_finemoved = 0;
! self->x_put_in2out = 0;
! self->x_change = 0;
! self->x_lin0_log1 = 0;
! self->x_steady = 0;
! return self;
}
--- 503,528 ----
class_addmethod(c, (t_method)iemgui_label_pos, gensym("label_pos"), A_GIMME, 0);
class_addmethod(c, (t_method)iemgui_label_font, gensym("label_font"), A_GIMME, 0);
+ class_setpropertiesfn(c, iemgui_propertiesfn);
}
EXTERN t_iemgui *iemgui_new(t_class *qlass) {
! t_iemgui *x = (t_iemgui *)pd_new(qlass);
! x->x_glist = (t_glist *)canvas_getcurrent();
! x->x_w = x->x_h = IEM_GUI_DEFAULTSIZE;
! x->x_ldx=0;
! x->x_ldy=-6;
! iem_inttosymargs(x,0);
! x->x_font_style = 0;
! x->x_fontsize = 8;
! x->x_selected = x->x_finemoved = x->x_put_in2out =
! x->x_change = x->x_lin0_log1 = x->x_steady = 0;
! x->x_snd = gensym("empty"); x->x_snd_unexpanded = 0;
! x->x_rcv = gensym("empty"); x->x_rcv_unexpanded = 0;
! x->x_lab = gensym("empty"); x->x_lab_unexpanded = 0;
! x->x_bcol = 0xffffff;
! x->x_fcol = 0x000000;
! x->x_lcol = 0x000000;
! x->x_snd_able = x->x_rcv_able = 0;
! return x;
}
***************
*** 580,589 ****
}
! /*
! EXTERN t_symbol *iemgui_gensym(void *x) {
! char buf[42];
! sprintf(buf,"x%x",(int)x);
! fprintf(stderr,"gensym: %s\n",buf);
! return gensym(x);
}
- */
--- 538,552 ----
}
! void iemgui_propertiesfn(t_gobj *x, t_glist *owner)
! {
! t_symbol *stub = gfxstub_new((t_pd *)x,x,0);
! pd_upload(x,owner);
! sys_vgui("pdtk_iemgui_dialog %s %x\n", stub->s_name, x);
! }
!
! void iemgui_constrain(t_iemgui *x) {
! x->x_fontsize = MAX(x->x_fontsize,4);
! x->x_h = iemgui_clip_size(x->x_h);
! x->x_w = iemgui_clip_size(x->x_w);
! iemgui_verify_snd_ne_rcv(x);
}
Index: g_mycanvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_mycanvas.c,v
retrieving revision 1.1.1.3.2.2.2.10
retrieving revision 1.1.1.3.2.2.2.11
diff -C2 -d -r1.1.1.3.2.2.2.10 -r1.1.1.3.2.2.2.11
*** g_mycanvas.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.10
--- g_mycanvas.c 3 May 2004 17:03:29 -0000 1.1.1.3.2.2.2.11
***************
*** 45,49 ****
int bflcol[3];
t_symbol *srl[3];
-
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiisssiiiiiii", gensym("#X"),gensym("obj"),
--- 45,48 ----
***************
*** 56,69 ****
}
- static void my_canvas_properties(t_gobj *z, t_glist *owner)
- {
- t_my_canvas *x = (t_my_canvas *)z;
- t_symbol *stub = gfxstub_new((t_pd *)x,x,0);
- pd_upload((t_gobj *)x,owner);
- sys_vgui("pdtk_iemgui_dialog %s selectable_dimensions(pix): %d %d size: 0.0 0.0 empty \
- visible_rectangle(pix)(pix): %d width: %d height: 0 empty empty empty -1 %x\n",
- stub->s_name, x->x_gui.x_w, 1, x->x_vis_w, x->x_vis_h, x);
- }
-
static void my_canvas_get_pos(t_my_canvas *x)
{
--- 55,58 ----
***************
*** 76,93 ****
}
- static void my_canvas_dialog(t_my_canvas *x, t_symbol *s, int argc, t_atom *argv)
- {
- t_symbol *srl[3];
- int a = (int)atom_getintarg(0, argc, argv);
- int w = (int)atom_getintarg(2, argc, argv);
- int h = (int)atom_getintarg(3, argc, argv);
- iemgui_dialog(&x->x_gui, srl, argc, argv);
- x->x_gui.x_loadinit = 0;
- x->x_gui.x_h = x->x_gui.x_w = MAX(a,1);
- x->x_vis_w = MAX(w,1);
- x->x_vis_h = MAX(h,1);
- x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
- }
-
static void my_canvas_size(t_my_canvas *x, t_symbol *s, int ac, t_atom *av)
{
--- 65,68 ----
***************
*** 105,166 ****
}
static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv)
{
! t_my_canvas *x = (t_my_canvas *)iemgui_new(my_canvas_class);
! int bflcol[]={~0707070, ~0000000, ~0202020};
! int a=IEM_GUI_DEFAULTSIZE, w=100, h=60, ldx=20, ldy=12, i=0, fs=14;
! iem_inttosymargs(&x->x_gui, 0);
! x->x_gui.x_font_style = 0;
! if(((argc >= 10)&&(argc <= 13))
! &&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2))
! {
! /*pd_scanargs(argc,argv,"iii;",&a,&w,&h);*/
! a = (int)atom_getintarg(0, argc, argv);
! w = (int)atom_getintarg(1, argc, argv);
! h = (int)atom_getintarg(2, argc, argv);
! }
! if((argc >= 12)&&(IS_A_SYMBOL(argv,3)||IS_A_FLOAT(argv,3))&&(IS_A_SYMBOL(argv,4)||IS_A_FLOAT(argv,4)))
! {i=2; iemgui_new_getnames(&x->x_gui, 3, argv);}
! else if((argc == 11)&&(IS_A_SYMBOL(argv,3)||IS_A_FLOAT(argv,3)))
! {i=1; iemgui_new_getnames(&x->x_gui, 3, argv);}
! else iemgui_new_getnames(&x->x_gui, 3, 0);
! if(((argc >= 10)&&(argc <= 13))
! &&(IS_A_SYMBOL(argv,i+3)||IS_A_FLOAT(argv,i+3))&&IS_A_FLOAT(argv,i+4)
! &&IS_A_FLOAT(argv,i+5)&&IS_A_FLOAT(argv,i+6)
! &&IS_A_FLOAT(argv,i+7)&&IS_A_FLOAT(argv,i+8)
! &&IS_A_FLOAT(argv,i+9))
! {
! /* disastrously, the "label" sits in a different part of the message.
! So we have to track its location separately (in the slot x_labelbindex)
! and initialize it specially here. */
! iemgui_new_dogetname(&x->x_gui, i+3, argv);
! x->x_gui.x_labelbindex = i+3;
! ldx = (int)atom_getintarg(i+4, argc, argv);
! ldy = (int)atom_getintarg(i+5, argc, argv);
! x->x_gui.x_font_style = atom_getintarg(i+6, argc, argv);
! fs = (int)atom_getintarg(i+7, argc, argv);
! bflcol[0] = (int)atom_getintarg(i+8, argc, argv);
! bflcol[2] = (int)atom_getintarg(i+9, argc, argv);
! }
! if((argc == 13)&&IS_A_FLOAT(argv,i+10))
! iem_inttosymargs(&x->x_gui, atom_getintarg(i+10, argc, argv));
! x->x_gui.x_draw = (t_iemfunptr)my_canvas_draw;
! x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! x->x_gui.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
! x->x_gui.x_h = x->x_gui.x_w = MAX(a,1);
! x->x_vis_w = MAX(w,1);
! x->x_vis_h = MAX(h,1);
! iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_font_style);
! if (x->x_gui.x_rcv_able)
! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
! x->x_gui.x_ldx = ldx;
! x->x_gui.x_ldy = ldy;
! x->x_gui.x_fontsize = MAX(fs,4);
! iemgui_all_colfromload(&x->x_gui, bflcol);
! x->x_at[0].a_type = A_FLOAT;
! x->x_at[1].a_type = A_FLOAT;
! iemgui_verify_snd_ne_rcv(&x->x_gui);
! return (x);
}
--- 80,115 ----
}
+ static void my_canvas_reload(t_my_canvas *x, int argc, t_atom *argv)
+ {
+ t_iemgui *y = (t_iemgui *)x;
+ int isa=0;
+ if (!pd_scanargs(argc,argv,"iiiaaaiiiicc;i",&y->x_w,&x->x_vis_w,&x->x_vis_h,
+ &y->x_snd,&y->x_rcv,&y->x_lab,&y->x_ldx,&y->x_ldy,
+ &y->x_font_style,&y->x_fontsize,&y->x_bcol,&y->x_lcol,&isa)) return;
+ y->x_binbufindex = 3;
+ y->x_labelbindex = 3+3;
+ iem_inttosymargs(y,isa);
+ y->x_h = y->x_w = MAX(y->x_w,1);
+ x->x_vis_w = MAX(x->x_vis_w,1);
+ x->x_vis_h = MAX(x->x_vis_h,1);
+ x->x_at[0].a_type = x->x_at[1].a_type = A_FLOAT; //???
+ iemgui_constrain(y);
+ y->x_snd_able = y->x_snd!=sym_empty;
+ y->x_rcv_able = y->x_rcv!=sym_empty;
+ if (y->x_rcv_able) pd_bind((t_pd *)x, y->x_rcv);
+ }
+
static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv)
{
! t_iemgui *y = iemgui_new(my_canvas_class);
! t_my_canvas *x = (t_my_canvas *)y;
! y->x_draw = (t_iemfunptr)my_canvas_draw;
! y->x_bcol = 0xe0e0e0;
! y->x_fcol = 0x000000;
! y->x_lcol = 0x404040;
! y->x_w=100;
! y->x_h=60;
! my_canvas_reload(x,argc,argv);
! return x;
}
***************
*** 178,186 ****
(t_method)my_canvas_ff, sizeof(t_my_canvas), CLASS_NOINLET, A_GIMME, 0);
class_addcreator((t_newmethod)my_canvas_new, gensym("my_canvas"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_dialog, gensym("dialog"), A_GIMME, 0);
class_addmethod(c, (t_method)my_canvas_size, gensym("size"), A_GIMME, 0);
class_addmethod(c, (t_method)my_canvas_vis_size, gensym("vis_size"), A_GIMME, 0);
class_addmethod(c, (t_method)my_canvas_get_pos, gensym("get_pos"), 0);
! iemgui_register_class(c);
wb.w_getrectfn = my_canvas_getrect;
wb.w_displacefn = iemgui_displace;
--- 127,135 ----
(t_method)my_canvas_ff, sizeof(t_my_canvas), CLASS_NOINLET, A_GIMME, 0);
class_addcreator((t_newmethod)my_canvas_new, gensym("my_canvas"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_canvas_reload, gensym("reload"), A_GIMME, 0);
class_addmethod(c, (t_method)my_canvas_size, gensym("size"), A_GIMME, 0);
class_addmethod(c, (t_method)my_canvas_vis_size, gensym("vis_size"), A_GIMME, 0);
class_addmethod(c, (t_method)my_canvas_get_pos, gensym("get_pos"), 0);
! iemgui_subclass(c);
wb.w_getrectfn = my_canvas_getrect;
wb.w_displacefn = iemgui_displace;
***************
*** 193,196 ****
class_sethelpsymbol(c, gensym("my_canvas"));
class_setsavefn(c, my_canvas_save);
- class_setpropertiesfn(c, my_canvas_properties);
}
--- 142,144 ----
Index: u_object.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v
retrieving revision 1.1.2.32
retrieving revision 1.1.2.33
diff -C2 -d -r1.1.2.32 -r1.1.2.33
*** u_object.tk 3 May 2004 05:37:13 -0000 1.1.2.32
--- u_object.tk 3 May 2004 17:03:29 -0000 1.1.2.33
***************
*** 25,31 ****
regsub {;$} $c {} c
if {$c<0} {
! set r [expr 4*(((~$c)>>12)&63)]
! set g [expr 4*(((~$c)>> 6)&63)]
! set b [expr 4*(((~$c)>> 0)&63)]
return [format #%02x%02x%02x $r $g $b]
} {
--- 25,31 ----
regsub {;$} $c {} c
if {$c<0} {
! set r [expr (((~$c)>>12)&63)*255/63]
! set g [expr (((~$c)>> 6)&63)*255/63]
! set b [expr (((~$c)>> 0)&63)*255/63]
return [format #%02x%02x%02x $r $g $b]
} {
Index: g_array.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_array.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_array.c 3 May 2004 02:57:27 -0000 1.1.1.3.2.2.2.6
--- g_array.c 3 May 2004 17:03:28 -0000 1.1.1.3.2.2.2.7
***************
*** 411,415 ****
xonset, yonset, wonset, i, xloc, yloc, xinc,
&pxpix, &pypix, &pwpix);
! if (pwpix < 4) pwpix = 4;
dx = fabsf(pxpix-xpix);
if (dx > 8) continue;
--- 411,415 ----
xonset, yonset, wonset, i, xloc, yloc, xinc,
&pxpix, &pypix, &pwpix);
! pwpix = MAX(4,pwpix);
dx = fabsf(pxpix-xpix);
if (dx > 8) continue;
***************
*** 430,434 ****
xonset, yonset, wonset, i, xloc, yloc, xinc,
&pxpix, &pypix, &pwpix);
! if (pwpix < 4) pwpix = 4;
dx = fabsf(pxpix-xpix);
dy = fabsf(pypix-ypix);
--- 430,434 ----
xonset, yonset, wonset, i, xloc, yloc, xinc,
&pxpix, &pypix, &pwpix);
! pwpix = MAX(4,pwpix);
dx = fabsf(pxpix-xpix);
dy = fabsf(pypix-ypix);
***************
*** 609,613 ****
glist_ytopixels(glist, yval));
ndrawn++;
! if (ndrawn%4==0) sys_vgui("\\\n");
}
lastpixel = ixpix;
--- 609,613 ----
glist_ytopixels(glist, yval));
ndrawn++;
! if (ndrawn%5==0) sys_vgui("\\\n");
}
lastpixel = ixpix;
Index: g_vumeter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_vumeter.c,v
retrieving revision 1.1.1.3.2.2.2.14
retrieving revision 1.1.1.3.2.2.2.15
diff -C2 -d -r1.1.1.3.2.2.2.14 -r1.1.1.3.2.2.2.15
*** g_vumeter.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.14
--- g_vumeter.c 3 May 2004 17:03:29 -0000 1.1.1.3.2.2.2.15
***************
*** 113,143 ****
{x->x_scale = !!fscale; x->x_gui.x_draw(x, x->x_gui.x_glist,0);}
- static void vu_properties(t_gobj *z, t_glist *owner)
- {
- t_vu *x = (t_vu *)z;
- t_symbol *stub = gfxstub_new((t_pd *)x,x,0);
- pd_upload((t_gobj *)x,owner);
- sys_vgui("pdtk_iemgui_dialog %s dimensions(pix)(pix): %d 8 width: %d 80 height: \
- empty 0.0 empty 0.0 empty 0 no_scale scale empty -1 %x\n",
- stub->s_name, x->x_gui.x_w, x->x_gui.x_h, x);
- }
-
- static void vu_dialog(t_vu *x, t_symbol *s, int argc, t_atom *argv)
- {
- t_symbol *srl[3];
- int w = (int)atom_getintarg(0, argc, argv);
- int h = (int)atom_getintarg(1, argc, argv);
- int scale = (int)atom_getintarg(4, argc, argv);
- srl[0] = gensym("empty");
- iemgui_dialog(&x->x_gui, srl, argc, argv);
- x->x_gui.x_snd_able = 0;
- x->x_gui.x_loadinit = 0;
- x->x_gui.x_w = iemgui_clip_size(w);
- vu_check_height(x, h);
- vu_scale(x, (float)!!scale);
- x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
- canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
- }
-
static void vu_size(t_vu *x, t_symbol *s, int ac, t_atom *av)
{
--- 113,116 ----
***************
*** 184,225 ****
}
static void *vu_new(t_symbol *s, int argc, t_atom *argv)
{
! t_vu *x = (t_vu *)iemgui_new(vu_class);
! int bflcol[]={-66577, -1, -1};
! int w=IEM_GUI_DEFAULTSIZE, h=IEM_VU_STEPS*IEM_VU_DEFAULTSIZE;
! int ldx=-1, ldy=-8, fs=8, scale=1;
! iem_inttosymargs(&x->x_gui, 0);
! x->x_gui.x_font_style=0;
! if(pd_scanargs(argc,argv,"ii??ii?iiii*",
! &w,&h,&ldx,&ldy,&fs,&bflcol[0],&bflcol[2],&scale))
! {
! iemgui_new_getnames(&x->x_gui, 1, argv); /*???*/
! x->x_gui.x_font_style = atom_getintarg(6, argc, argv);
! }
! else iemgui_new_getnames(&x->x_gui, 1, 0);
! if((argc == 12)&&IS_A_FLOAT(argv,11))
! iem_inttosymargs(&x->x_gui, atom_getintarg(11, argc, argv));
! x->x_gui.x_draw = (t_iemfunptr)vu_draw;
! x->x_gui.x_snd_able = 0;
! x->x_gui.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
! iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_font_style);
! if(x->x_gui.x_rcv_able) pd_bind((t_pd *)x, x->x_gui.x_rcv);
! x->x_gui.x_ldx = ldx;
! x->x_gui.x_ldy = ldy;
! x->x_gui.x_fontsize = MAX(fs,4);
! x->x_gui.x_w = iemgui_clip_size(w);
! vu_check_height(x, h);
! iemgui_all_colfromload(&x->x_gui, bflcol);
! x->x_scale = !! scale;
x->x_peak = 0;
x->x_rms = 0;
x->x_fp = -101.0;
x->x_fr = -101.0;
! iemgui_verify_snd_ne_rcv(&x->x_gui);
! inlet_new(&x->x_gui.x_obj, &x->x_gui.x_obj.ob_pd, &s_float, gensym("ft1"));
! x->x_out_rms = outlet_new(&x->x_gui.x_obj, &s_float);
! x->x_out_peak = outlet_new(&x->x_gui.x_obj, &s_float);
! return (x);
}
--- 157,192 ----
}
+ static void vu_reload(t_vu *x, int argc, t_atom *argv)
+ {
+ t_iemgui *y = (t_iemgui *)x;
+ int isa=0;
+ if(!pd_scanargs(argc,argv,"iiaaiiiiccb;i",
+ &y->x_w,&y->x_h,&y->x_rcv,&y->x_lab,&y->x_ldx,&y->x_ldy,&y->x_font_style,&y->x_fontsize,
+ &y->x_bcol,&y->x_lcol,&x->x_scale,&isa)) return;
+ iem_inttosymargs(&x->x_gui,isa);
+ iemgui_constrain(y);
+ y->x_rcv_able = y->x_rcv!=sym_empty;
+ if(y->x_rcv_able) pd_bind((t_pd *)x, y->x_rcv);
+ }
+
static void *vu_new(t_symbol *s, int argc, t_atom *argv)
{
! t_iemgui *y = iemgui_new(vu_class);
! t_vu *x = (t_vu *)y;
! y->x_draw = (t_iemfunptr)vu_draw;
! x->x_out_rms = outlet_new(&y->x_obj, &s_float);
! x->x_out_peak = outlet_new(&y->x_obj, &s_float);
! y->x_h=IEM_VU_STEPS*IEM_VU_DEFAULTSIZE;
! x->x_scale = 1;
x->x_peak = 0;
x->x_rms = 0;
x->x_fp = -101.0;
x->x_fr = -101.0;
! y->x_binbufindex = 1;
! y->x_labelbindex = 1+3;
! vu_check_height(x, y->x_h);
! inlet_new(&y->x_obj, &y->x_obj.ob_pd, &s_float, gensym("ft1"));
! vu_reload(x,argc,argv);
! return x;
}
***************
*** 235,245 ****
t_class *c = vu_class = class_new(gensym("vu"),
(t_newmethod)vu_new, (t_method)vu_free, sizeof(t_vu), 0, A_GIMME, 0);
class_addbang(c,vu_bang);
class_addfloat(c,vu_float);
class_addmethod(c, (t_method)vu_ft1, gensym("ft1"), A_FLOAT, 0);
! class_addmethod(c, (t_method)vu_dialog, gensym("dialog"), A_GIMME, 0);
class_addmethod(c, (t_method)vu_size, gensym("size"), A_GIMME, 0);
class_addmethod(c, (t_method)vu_scale, gensym("scale"), A_DEFFLOAT, 0);
- iemgui_register_class(c);
wb.w_getrectfn = vu_getrect;
wb.w_displacefn = iemgui_displace;
--- 202,212 ----
t_class *c = vu_class = class_new(gensym("vu"),
(t_newmethod)vu_new, (t_method)vu_free, sizeof(t_vu), 0, A_GIMME, 0);
+ iemgui_subclass(c);
class_addbang(c,vu_bang);
class_addfloat(c,vu_float);
class_addmethod(c, (t_method)vu_ft1, gensym("ft1"), A_FLOAT, 0);
! class_addmethod(c, (t_method)vu_reload, gensym("reload"), A_GIMME, 0);
class_addmethod(c, (t_method)vu_size, gensym("size"), A_GIMME, 0);
class_addmethod(c, (t_method)vu_scale, gensym("scale"), A_DEFFLOAT, 0);
wb.w_getrectfn = vu_getrect;
wb.w_displacefn = iemgui_displace;
***************
*** 252,255 ****
class_sethelpsymbol(c, gensym("vu"));
class_setsavefn(c, vu_save);
- class_setpropertiesfn(c, vu_properties);
}
--- 219,221 ----
Index: g_hslider.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v
retrieving revision 1.1.1.3.2.2.2.20
retrieving revision 1.1.1.3.2.2.2.21
diff -C2 -d -r1.1.1.3.2.2.2.20 -r1.1.1.3.2.2.2.21
*** g_hslider.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.20
--- g_hslider.c 3 May 2004 17:03:28 -0000 1.1.1.3.2.2.2.21
***************
*** 26,42 ****
#define CLAMP(_var,_min,_max) { if (_var<_min) _var=_min; else if (_var>_max) _var=_max; }
! static t_class *hslider_class;
! static t_class *vslider_class;
/* widget helper functions */
! static int isvert(t_hslider *x) {
! t_class *c = x->x_gui.x_obj.te_g.g_pd;
! if (c==vslider_class) return 1;
! if (c==hslider_class) return 0;
! abort();
}
! static void hslider_draw(t_hslider *x, t_glist *glist, int mode)
{
if (mode==IEM_GUI_DRAW_MODE_ERASE) {
--- 26,39 ----
#define CLAMP(_var,_min,_max) { if (_var<_min) _var=_min; else if (_var>_max) _var=_max; }
! static t_class *slider_class;
! static t_symbol *sym_vsl, *sym_vslider;
/* widget helper functions */
! static int isvert(t_slider *x) {
! return x->x_flavor == sym_vsl || x->x_flavor == sym_vslider;
}
! static void slider_draw(t_slider *x, t_glist *glist, int mode)
{
if (mode==IEM_GUI_DRAW_MODE_ERASE) {
***************
*** 53,59 ****
/* ------------------------ hsl widgetbehaviour----------------------------- */
! static void hslider_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2)
{
! t_hslider* x = (t_hslider*)z;
*xp1 = text_xpix((t_text *)x, glist) - (isvert(x)?0:3);
*yp1 = text_ypix((t_text *)x, glist) - (isvert(x)?2:0);
--- 50,56 ----
/* ------------------------ hsl widgetbehaviour----------------------------- */
! static void slider_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2)
{
! t_slider* x = (t_slider*)z;
*xp1 = text_xpix((t_text *)x, glist) - (isvert(x)?0:3);
*yp1 = text_ypix((t_text *)x, glist) - (isvert(x)?2:0);
***************
*** 62,88 ****
}
! static void hslider_save(t_gobj *z, t_binbuf *b)
{
! t_hslider *x = (t_hslider *)z;
int bflcol[3];
t_symbol *srl[3];
-
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiffiisssiiiiiiiii", gensym("#X"),gensym("obj"),
(t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix,
isvert(x) ? gensym("vsl") : gensym("hsl"), x->x_gui.x_w, x->x_gui.x_h,
! (float)x->x_min, (float)x->x_max, x->x_lin0_log1, iem_symargstoint(&x->x_gui),
srl[0], srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy,
x->x_gui.x_font_style, x->x_gui.x_fontsize,
bflcol[0], bflcol[1], bflcol[2],
! x->x_val, x->x_steady);
binbuf_addv(b, ";");
}
! static void hslider_check_width(t_hslider *x, int w)
{
double l = (double)(isvert(x) ? x->x_gui.x_h : x->x_gui.x_w)-1;
int m = l*100;
! double span = x->x_lin0_log1 ? log(x->x_max/x->x_min) : (x->x_max - x->x_min);
if(w < IEM_SL_MINSIZE) w = IEM_SL_MINSIZE;
if (isvert(x)) {x->x_gui.x_h=w;} else {x->x_gui.x_w=w;}
--- 59,84 ----
}
! static void slider_save(t_gobj *z, t_binbuf *b)
{
! t_slider *x = (t_slider *)z;
int bflcol[3];
t_symbol *srl[3];
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiffiisssiiiiiiiii", gensym("#X"),gensym("obj"),
(t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix,
isvert(x) ? gensym("vsl") : gensym("hsl"), x->x_gui.x_w, x->x_gui.x_h,
! (float)x->x_min, (float)x->x_max, x->x_gui.x_lin0_log1, iem_symargstoint(&x->x_gui),
srl[0], srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy,
x->x_gui.x_font_style, x->x_gui.x_fontsize,
bflcol[0], bflcol[1], bflcol[2],
! x->x_val, x->x_gui.x_steady);
binbuf_addv(b, ";");
}
! static void slider_check_width(t_slider *x, int w)
{
double l = (double)(isvert(x) ? x->x_gui.x_h : x->x_gui.x_w)-1;
int m = l*100;
! double span = x->x_gui.x_lin0_log1 ? log(x->x_max/x->x_min) : (x->x_max - x->x_min);
if(w < IEM_SL_MINSIZE) w = IEM_SL_MINSIZE;
if (isvert(x)) {x->x_gui.x_h=w;} else {x->x_gui.x_w=w;}
***************
*** 91,99 ****
}
! static void hslider_check_minmax(t_hslider *x, double min, double max)
{
double diff;
! 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; }
--- 87,94 ----
}
! static void slider_check_minmax(t_slider *x, double min, double max)
{
double diff;
! if(x->x_gui.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; }
***************
*** 102,106 ****
x->x_min = min;
x->x_max = max;
! diff = x->x_lin0_log1 ? log(x->x_max/x->x_min) : (x->x_max - x->x_min);
x->x_k = isvert(x) ?
diff/(double)(x->x_gui.x_h - 1) :
--- 97,101 ----
x->x_min = min;
x->x_max = max;
! diff = x->x_gui.x_lin0_log1 ? log(x->x_max/x->x_min) : (x->x_max - x->x_min);
x->x_k = isvert(x) ?
diff/(double)(x->x_gui.x_h - 1) :
***************
*** 108,122 ****
}
! static void hslider_properties(t_gobj *z, t_glist *owner)
! {
! t_hslider *x = (t_hslider *)z;
! t_symbol *stub = gfxstub_new((t_pd *)x,x,0);
! pd_upload((t_gobj *)x,owner);
! sys_vgui("pdtk_iemgui_dialog %s dimensions(pix)(pix): %d 8 width: %d 8 height: \
! output-range: left: right: 0.0 lin log empty -1 %x\n",
! stub->s_name, x->x_gui.x_w, x->x_gui.x_h, x);
! }
!
! static void hslider_set(t_hslider *x, t_floatarg f)
{
double g;
--- 103,107 ----
}
! static void slider_set(t_slider *x, t_floatarg f)
{
double g;
***************
*** 125,129 ****
else { /* normal */
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);
x->x_pos = x->x_val;
--- 110,114 ----
else { /* normal */
CLAMP(f,x->x_min,x->x_max); }
! g = (x->x_gui.x_lin0_log1 ? log(f/x->x_min) : (f-x->x_min)) / x->x_k;
x->x_val = (int)(100.0*g + 0.49999);
x->x_pos = x->x_val;
***************
*** 131,137 ****
}
! static void hslider_bang(t_hslider *x)
{
! double out = x->x_lin0_log1 ?
x->x_min*exp(x->x_k*(double)(x->x_val)*0.01) :
(double)(x->x_val)*0.01*x->x_k + x->x_min;
--- 116,122 ----
}
! static void slider_bang(t_slider *x)
{
! double out = x->x_gui.x_lin0_log1 ?
x->x_min*exp(x->x_k*(double)(x->x_val)*0.01) :
(double)(x->x_val)*0.01*x->x_k + x->x_min;
***************
*** 142,190 ****
}
! static void hslider_dialog(t_hslider *x, t_symbol *s, int argc, t_atom *argv)
! {
! t_symbol *srl[3];
! int w = (int)atom_getintarg(0, argc, argv);
! int h = (int)atom_getintarg(1, argc, argv);
! double min = (double)atom_getfloatarg(2, argc, argv);
! double max = (double)atom_getfloatarg(3, argc, argv);
! int lilo = (int)atom_getintarg(4, argc, argv);
! int steady = (int)atom_getintarg(17, argc, argv);
! x->x_lin0_log1 = !!lilo;
! x->x_steady = !!steady;
! iemgui_dialog(&x->x_gui, srl, argc, argv);
! if (isvert(x)) {
! x->x_gui.x_w = iemgui_clip_size(w); hslider_check_width(x, h);
! } else {
! x->x_gui.x_h = iemgui_clip_size(h); hslider_check_width(x, w);
! }
! hslider_check_minmax(x, min, max);
! x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
! canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
! }
!
! static void hslider_motion(t_hslider *x, t_floatarg dx, t_floatarg dy)
{
int old = x->x_val;
! int m = (isvert(x) ? x->x_gui.x_h : x->x_gui.x_w)*100 - 100;
! x->x_pos += (x->x_gui.x_finemoved ? 1 : 100)
! * (int)(isvert(x) ? -dy : dx);
x->x_val = x->x_pos;
! if(x->x_val > m) {x->x_val = m; x->x_pos += 50; x->x_pos -= x->x_pos%100;}
! if(x->x_val < 0) {x->x_val = 0; x->x_pos -= 50; x->x_pos -= x->x_pos%100;}
! if(old != x->x_val)
! {
x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
! hslider_bang(x);
}
}
! static void hslider_size(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{
if (isvert(x)) {
x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
! if(ac > 1) hslider_check_width(x, (int)atom_getintarg(1, ac, av));
}else{
! hslider_check_width(x, (int)atom_getintarg(0, ac, av));
if(ac > 1) x->x_gui.x_h = iemgui_clip_size((int)atom_getintarg(1, ac, av));
}
--- 127,152 ----
}
! static void slider_motion(t_slider *x, t_floatarg dx, t_floatarg dy)
{
int old = x->x_val;
! int l = isvert(x) ? x->x_gui.x_h : x->x_gui.x_w;
! int m = (l-1)*100;
! x->x_pos += (x->x_gui.x_finemoved?1:100)*(int)(isvert(x) ? -dy : dx);
x->x_val = x->x_pos;
! if(x->x_val>m) {x->x_val=m; x->x_pos+=50; x->x_pos-=x->x_pos%100;}
! if(x->x_val<0) {x->x_val=0; x->x_pos-=50; x->x_pos-=x->x_pos%100;}
! if(old != x->x_val) {
x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
! slider_bang(x);
}
}
! static void slider_size(t_slider *x, t_symbol *s, int ac, t_atom *av)
{
if (isvert(x)) {
x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
! if(ac > 1) slider_check_width(x, (int)atom_getintarg(1, ac, av));
}else{
! slider_check_width(x, (int)atom_getintarg(0, ac, av));
if(ac > 1) x->x_gui.x_h = iemgui_clip_size((int)atom_getintarg(1, ac, av));
}
***************
*** 192,215 ****
}
! static void hslider_range(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{
! hslider_check_minmax(x,
(double)atom_getfloatarg(0, ac, av),
(double)atom_getfloatarg(1, ac, av));
}
! static void hslider_log(t_hslider *x)
! {x->x_lin0_log1 = 1; hslider_check_minmax(x, x->x_min, x->x_max);}
! static void hslider_lin(t_hslider *x)
! {x->x_lin0_log1 = 0; x->x_k = (x->x_max-x->x_min)/(double)((isvert(x)?x->x_gui.x_h:x->x_gui.x_w) - 1);}
! static void hslider_init(t_hslider *x, t_floatarg f) {x->x_gui.x_loadinit = !!f;}
! static void hslider_steady(t_hslider *x, t_floatarg f) {x->x_steady = !!f;}
! static void hslider_float(t_hslider *x, t_floatarg f)
{
! hslider_set(x, f);
if(x->x_gui.x_put_in2out) {
! double out = x->x_lin0_log1 ?
x->x_min*exp(x->x_k*(double)(x->x_val)*0.01) :
(double)(x->x_val)*0.01*x->x_k + x->x_min;
--- 154,175 ----
}
! static void slider_range(t_slider *x, t_symbol *s, int ac, t_atom *av)
{
! slider_check_minmax(x,
(double)atom_getfloatarg(0, ac, av),
(double)atom_getfloatarg(1, ac, av));
}
! static void slider_lin(t_slider *x) {x->x_gui.x_lin0_log1 = 0; x->x_k = (x->x_max-x->x_min)/(double)((isvert(x)?x->x_gui.x_h:x->x_gui.x_w) - 1);}
! static void slider_log(t_slider *x) {x->x_gui.x_lin0_log1 = 1; slider_check_minmax(x, x->x_min, x->x_max);}
! static void slider_init(t_slider *x, t_floatarg f) {x->x_gui.x_loadinit = !!f;}
! static void slider_steady(t_slider *x, t_floatarg f) {x->x_gui.x_steady = !!f;}
! static void slider_float(t_slider *x, t_floatarg f)
{
! slider_set(x, f);
if(x->x_gui.x_put_in2out) {
! double out = x->x_gui.x_lin0_log1 ?
x->x_min*exp(x->x_k*(double)(x->x_val)*0.01) :
(double)(x->x_val)*0.01*x->x_k + x->x_min;
***************
*** 221,284 ****
}
! static void hslider_loadbang(t_hslider *x)
{
if(!sys_noloadbang && x->x_gui.x_loadinit)
{
x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
! hslider_bang(x);
}
}
! static void *hslider_new(t_symbol *s, int argc, t_atom *argv)
{
! int bflcol[]={-262144, -1, -1};
! int w=IEM_SL_DEFAULTSIZE, h=IEM_GUI_DEFAULTSIZE;
! int ldx=-2, ldy=-6, isa=0, fstyle=0, fs=8;
! int lilo=0, v=0, steady=1;
! double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1);
! t_hslider *x;
! t_symbol *srl[3]={0,0,0};
! if (s==gensym("hsl") || s==gensym("hslider")) {
! x = (t_hslider *)iemgui_new(hslider_class);
! } else if (s==gensym("vsl") || s==gensym("vslider")) {
! x = (t_hslider *)iemgui_new(vslider_class);
! } else abort();
! if (isvert(x)) w=IEM_GUI_DEFAULTSIZE, h=IEM_SL_DEFAULTSIZE;
! if(pd_scanargs(argc,argv,"iiddiiaaaiiiiiiii;?",
! &w,&h,&min,&max,&lilo,&isa,&srl[0],&srl[1],&srl[2],
! &ldx,&ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2],&v))
! {
! iem_inttosymargs(&x->x_gui, isa);
! iemgui_new_getnames2(&x->x_gui, 6, srl[0], srl[1], srl[2]);
! }
! else {
! post("HUH???");
! iemgui_new_getnames(&x->x_gui, 6, 0);
! }
! x->x_gui.x_font_style = fstyle;
! if((argc == 18)&&IS_A_FLOAT(argv,17)) steady=!!(int)atom_getintarg(17,argc,argv);
! x->x_gui.x_draw = (t_iemfunptr)hslider_draw;
! x->x_val = x->x_gui.x_loadinit ? v : 0;
! x->x_pos = x->x_val;
! x->x_lin0_log1 = !!lilo;
! x->x_steady = steady;
! x->x_gui.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
! iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_font_style);
! if(x->x_gui.x_rcv_able) pd_bind((t_pd *)x, x->x_gui.x_rcv);
! x->x_gui.x_ldx = ldx;
! x->x_gui.x_ldy = ldy;
! x->x_gui.x_fontsize = MAX(fs,4);
! if (isvert(x)) {x->x_gui.x_w = iemgui_clip_size(w); hslider_check_width(x, h);}
! else {x->x_gui.x_h = iemgui_clip_size(h); hslider_check_width(x, w);}
! hslider_check_minmax(x, min, max);
! iemgui_all_colfromload(&x->x_gui, bflcol);
! iemgui_verify_snd_ne_rcv(&x->x_gui);
! outlet_new(&x->x_gui.x_obj, &s_float);
return x;
}
! static void hslider_free(t_hslider *x)
{
if(x->x_gui.x_rcv_able) pd_unbind((t_pd *)x, x->x_gui.x_rcv);
--- 181,231 ----
}
! static void slider_loadbang(t_slider *x)
{
if(!sys_noloadbang && x->x_gui.x_loadinit)
{
x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
! slider_bang(x);
}
}
! static void slider_reload(t_slider *x, int argc, t_atom *argv)
{
! t_iemgui *y = (t_iemgui *)x;
! int isa=0, lin0_log1=0, v=0, steady=1;
! if(!pd_scanargs(argc,argv,"iiddbiaaaiiiiccci;b",
! &y->x_w,&y->x_h,&x->x_min,&x->x_max,&lin0_log1,&isa,&y->x_snd,&y->x_rcv,&y->x_lab,
! &y->x_ldx,&y->x_ldy,&y->x_font_style,&y->x_fontsize,
! &y->x_bcol,&y->x_fcol,&y->x_lcol,&v,&steady)) return;
! iem_inttosymargs(&x->x_gui, isa);
! y->x_lin0_log1=lin0_log1;
! x->x_pos = x->x_val = y->x_loadinit ? v : 0;
! y->x_steady = steady;
! iemgui_constrain(y);
! slider_check_minmax(x, x->x_min, x->x_max);
! if (isvert(x)) slider_check_width(x, y->x_h);
! else slider_check_width(x, y->x_w);
! y->x_snd_able = y->x_snd!=sym_empty;
! y->x_rcv_able = y->x_rcv!=sym_empty;
! if(y->x_rcv_able) pd_bind((t_pd *)x, y->x_rcv);
! }
! static void *slider_new(t_symbol *s, int argc, t_atom *argv)
! {
! t_iemgui *y = iemgui_new(slider_class);
! t_slider *x = (t_slider *)y;
! y->x_draw = (t_iemfunptr)slider_draw;
! x->x_flavor=s;
! x->x_min=0.0;
! x->x_max=(double)(IEM_SL_DEFAULTSIZE-1);
! if (isvert(x)) y->x_h=IEM_SL_DEFAULTSIZE; else y->x_w=IEM_SL_DEFAULTSIZE;
! y->x_binbufindex = 6;
! y->x_labelbindex = 6+3;
! outlet_new(&y->x_obj, &s_float);
! slider_reload(x,argc,argv);
return x;
}
! static void slider_free(t_slider *x)
{
if(x->x_gui.x_rcv_able) pd_unbind((t_pd *)x, x->x_gui.x_rcv);
***************
*** 286,319 ****
}
- static void hslider_methods(t_class *c) {
- class_addbang(c,hslider_bang);
- class_addfloat(c,hslider_float);
- class_addmethod(c, (t_method)hslider_motion, gensym("motion"), A_FLOAT, A_FLOAT, 0);
- class_addmethod(c, (t_method)hslider_dialog, gensym("dialog"), A_GIMME, 0);
- class_addmethod(c, (t_method)hslider_loadbang, gensym("loadbang"), 0);
- 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);
- class_addmethod(c, (t_method)hslider_init, gensym("init"), A_FLOAT, 0);
- class_addmethod(c, (t_method)hslider_steady, gensym("steady"), A_FLOAT, 0);
- }
-
static t_widgetbehavior wb;
! void g_hslider_setup(void)
{
! hslider_class = class_new(gensym("hsl"), (t_newmethod)hslider_new,
! (t_method)hslider_free, sizeof(t_hslider), 0, A_GIMME, 0);
! vslider_class = class_new(gensym("vsl"), (t_newmethod)hslider_new,
! (t_method)hslider_free, sizeof(t_hslider), 0, A_GIMME, 0);
! #ifndef GGEE_HSLIDER_COMPATIBLE
! class_addcreator((t_newmethod)hslider_new, gensym("hslider"), A_GIMME, 0);
! #endif
! class_addcreator((t_newmethod)hslider_new, gensym("vslider"), A_GIMME, 0);
! hslider_methods(hslider_class);
! hslider_methods(vslider_class);
! wb.w_getrectfn = hslider_getrect;
wb.w_displacefn = iemgui_displace;
wb.w_selectfn = iemgui_select;
--- 233,260 ----
}
static t_widgetbehavior wb;
! void g_slider_setup(void)
{
! t_class *c = slider_class = class_new(gensym("slider"), (t_newmethod)slider_new,
! (t_method)slider_free, sizeof(t_slider), 0, A_GIMME, 0);
! class_addcreator((t_newmethod)slider_new, gensym("hslider"), A_GIMME, 0);
! class_addcreator((t_newmethod)slider_new, gensym("vslider"), A_GIMME, 0);
! class_addcreator((t_newmethod)slider_new, gensym( "hsl"), A_GIMME, 0);
! class_addcreator((t_newmethod)slider_new, gensym( "vsl"), A_GIMME, 0);
! iemgui_subclass(c);
! class_addbang(c,slider_bang);
! class_addfloat(c,slider_float);
! class_addmethod(c, (t_method)slider_motion, gensym("motion"), A_FLOAT, A_FLOAT, 0);
! class_addmethod(c, (t_method)slider_reload, gensym("reload"), A_GIMME, 0);
! class_addmethod(c, (t_method)slider_loadbang, gensym("loadbang"), 0);
! class_addmethod(c, (t_method)slider_set, gensym("set"), A_FLOAT, 0);
! class_addmethod(c, (t_method)slider_size, gensym("size"), A_GIMME, 0);
! class_addmethod(c, (t_method)slider_log, gensym("log"), 0);
! class_addmethod(c, (t_method)slider_lin, gensym("lin"), 0);
! class_addmethod(c, (t_method)slider_init, gensym("init"), A_FLOAT, 0);
! class_addmethod(c, (t_method)slider_steady, gensym("steady"), A_FLOAT, 0);
!
! wb.w_getrectfn = slider_getrect;
wb.w_displacefn = iemgui_displace;
wb.w_selectfn = iemgui_select;
***************
*** 322,335 ****
wb.w_visfn = iemgui_vis;
wb.w_clickfn = 0;
!
! class_setwidget(hslider_class, &wb);
! class_setwidget(vslider_class, &wb);
! class_sethelpsymbol(hslider_class, gensym("hslider"));
! class_sethelpsymbol(vslider_class, gensym("vslider"));
! class_setsavefn(hslider_class, hslider_save);
! class_setsavefn(vslider_class, hslider_save);
! class_setpropertiesfn(hslider_class, hslider_properties);
! class_setpropertiesfn(vslider_class, hslider_properties);
}
-
- void g_vslider_setup(void) {}
--- 263,270 ----
wb.w_visfn = iemgui_vis;
wb.w_clickfn = 0;
! sym_vsl = gensym("vsl");
! sym_vslider = gensym("vslider");
! class_setwidget(c, &wb);
! class_sethelpsymbol(c, gensym("hslider"));
! class_setsavefn(c, slider_save);
}
Index: g_dropper.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/g_dropper.c,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -d -r1.1.2.10 -r1.1.2.11
*** g_dropper.c 3 May 2004 05:37:15 -0000 1.1.2.10
--- g_dropper.c 3 May 2004 17:03:28 -0000 1.1.2.11
***************
*** 45,58 ****
}
- static void dropper_dialog(t_dropper *x, t_symbol *s, int argc, t_atom *argv)
- {
- t_symbol *srl[3];
- int a = (int)atom_getintarg(0, argc, argv);
- /* int sr_flags = */ iemgui_dialog(&x->x_gui, srl, argc, argv);
- x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
- x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
- canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
- }
-
static void dropper_save(t_gobj *z, t_binbuf *b)
{
--- 45,48 ----
***************
*** 73,87 ****
}
- static void dropper_properties(t_gobj *z, t_glist *owner)
- {
- t_dropper *x = (t_dropper *)z;
- char buf[800];
- pd_upload((t_gobj *)x,owner);
- sprintf(buf, "pdtk_iemgui_dialog %%s DROPPER dimensions(pix): %d 8 size: 0 0 empty "
- "flash-time(ms)(ms): intrrpt: hold: 2 empty empty empty -1 %x\n",
- x->x_gui.x_w, x);
- gfxstub_new((t_pd *)x,x,buf);
- }
-
static void dropper_bang(t_dropper *x)
{
--- 63,66 ----
***************
*** 110,118 ****
{
iem_inttosymargs(&x->x_gui, isa);
! iemgui_new_getnames2(&x->x_gui, 2, srl[0], srl[1], srl[2]);
}
else {
post("ei??");
! iemgui_new_getnames(&x->x_gui, 6, 0);
}
x->x_gui.x_font_style = fstyle;
--- 89,97 ----
{
iem_inttosymargs(&x->x_gui, isa);
! //iemgui_new_getnames2(&x->x_gui, 2, srl[0], srl[1], srl[2]);
}
else {
post("ei??");
! //iemgui_new_getnames(&x->x_gui, 6, 0);
}
x->x_gui.x_font_style = fstyle;
***************
*** 123,127 ****
x->x_gui.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
x->x_gui.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
- iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_font_style);
if (x->x_gui.x_rcv_able)
pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
--- 102,105 ----
***************
*** 131,135 ****
x->x_gui.x_fontsize = MAX(fs,4);
x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
! iemgui_all_colfromload(&x->x_gui, bflcol);
x->x_gui.x_locked = 0;
iemgui_verify_snd_ne_rcv(&x->x_gui);
--- 109,113 ----
x->x_gui.x_fontsize = MAX(fs,4);
x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
! //iemgui_all_colfromload(&x->x_gui, bflcol);
x->x_gui.x_locked = 0;
iemgui_verify_snd_ne_rcv(&x->x_gui);
***************
*** 152,157 ****
class_addbang(c, dropper_bang);
class_addsymbol(c, dropper_symbol);
! class_addmethod(c, (t_method)dropper_dialog, gensym("dialog"), A_GIMME, 0);
! iemgui_register_class(c);
dropper_widgetbehavior.w_getrectfn = dropper_getrect;
dropper_widgetbehavior.w_displacefn = iemgui_displace;
--- 130,135 ----
class_addbang(c, dropper_bang);
class_addsymbol(c, dropper_symbol);
! //class_addmethod(c, (t_method)dropper_reload, gensym("reload"), A_GIMME, 0);
! iemgui_subclass(c);
dropper_widgetbehavior.w_getrectfn = dropper_getrect;
dropper_widgetbehavior.w_displacefn = iemgui_displace;
***************
*** 160,164 ****
dropper_widgetbehavior.w_deletefn = iemgui_delete;
dropper_widgetbehavior.w_visfn = iemgui_vis;
- class_setpropertiesfn(dropper_class, dropper_properties);
class_setwidget(dropper_class, &dropper_widgetbehavior);
class_sethelpsymbol(dropper_class, gensym("dropper"));
--- 138,141 ----
Index: g_bang.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v
retrieving revision 1.1.1.3.2.2.2.20
retrieving revision 1.1.1.3.2.2.2.21
diff -C2 -d -r1.1.1.3.2.2.2.20 -r1.1.1.3.2.2.2.21
*** g_bang.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.20
--- g_bang.c 3 May 2004 17:03:28 -0000 1.1.1.3.2.2.2.21
***************
*** 24,32 ****
#endif
- #define IEM_BNG_DEFAULTHOLDFLASHTIME 250
- #define IEM_BNG_DEFAULTBREAKFLASHTIME 50
- #define IEM_BNG_MINHOLDFLASHTIME 50
- #define IEM_BNG_MINBREAKFLASHTIME 10
-
static t_class *bng_class;
--- 24,27 ----
***************
*** 63,78 ****
void bng_check_minmax(t_bng *x, int ftbreak, int fthold) {
if(ftbreak > fthold) {int h = ftbreak; ftbreak = fthold; fthold = h;}
! x->x_flashtime_break = MAX(ftbreak,IEM_BNG_MINBREAKFLASHTIME);
! x->x_flashtime_hold = MAX(fthold, IEM_BNG_MINHOLDFLASHTIME);
! }
!
! static void bng_properties(t_gobj *z, t_glist *owner)
! {
! t_bng *x = (t_bng *)z;
! t_symbol *stub = gfxstub_new((t_pd *)x,x,0);
! pd_upload((t_gobj *)x,owner);
! sys_vgui("pdtk_iemgui_dialog %s dimensions(pix): %d 8 size: 0 0 empty "
! "flash-time(ms)(ms): intrrpt: hold: 2 empty empty empty -1 %x\n",
! stub->s_name, x->x_gui.x_w, x);
}
--- 58,63 ----
void bng_check_minmax(t_bng *x, int ftbreak, int fthold) {
if(ftbreak > fthold) {int h = ftbreak; ftbreak = fthold; fthold = h;}
! x->x_flashtime_break = MAX(ftbreak,10);
! x->x_flashtime_hold = MAX(fthold, 50);
}
***************
*** 111,127 ****
}
- static void bng_dialog(t_bng *x, t_symbol *s, int argc, t_atom *argv)
- {
- t_symbol *srl[3];
- int a = (int)atom_getintarg(0, argc, argv);
- int fthold = (int)atom_getintarg(2, argc, argv);
- int ftbreak = (int)atom_getintarg(3, argc, argv);
- iemgui_dialog(&x->x_gui, srl, argc, argv);
- x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
- bng_check_minmax(x, ftbreak, fthold);
- x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
- canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
- }
-
static void bng_float(t_bng *x, t_floatarg f) {bng_bang2(x);}
static void bng_symbol(t_bng *x, t_symbol *s) {bng_bang2(x);}
--- 96,99 ----
***************
*** 151,184 ****
static void bng_tick_lck(t_bng *x) {x->x_gui.x_locked = 0;}
static void *bng_new(t_symbol *s, int argc, t_atom *argv)
{
! t_bng *x = (t_bng *)iemgui_new(bng_class);
! int bflcol[]={-262144, -1, -1};
! int a=IEM_GUI_DEFAULTSIZE;
! int isa=0, fs=8;
! int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME,
! fthold= IEM_BNG_DEFAULTHOLDFLASHTIME;
! t_symbol *srl[3]={0,0,0};
! pd_scanargs(argc,argv,"iiiiaaaiiiiiii",
! &a,&fthold,&ftbreak,&isa,&srl[0],&srl[1],&srl[2],
! &x->x_gui.x_ldx,&x->x_gui.x_ldy,&x->x_gui.x_font_style,&fs,&bflcol[0],&bflcol[1],&bflcol[2]);
! iem_inttosymargs(&x->x_gui,isa);
! iemgui_new_getnames2(&x->x_gui, 4, srl[0], srl[1], srl[2]);
! x->x_gui.x_draw = (t_iemfunptr)bng_draw;
x->x_flashed = 0;
! x->x_gui.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
! iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_font_style);
! if (x->x_gui.x_rcv_able) pd_bind((t_pd *)x, x->x_gui.x_rcv);
! x->x_gui.x_fontsize = MAX(fs,4);
! x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a);
! bng_check_minmax(x, ftbreak, fthold);
! iemgui_all_colfromload(&x->x_gui, bflcol);
! x->x_gui.x_locked = 0;
! iemgui_verify_snd_ne_rcv(&x->x_gui);
x->x_clock_hld = clock_new(x, (t_method)bng_tick_hld);
x->x_clock_brk = clock_new(x, (t_method)bng_tick_brk);
x->x_clock_lck = clock_new(x, (t_method)bng_tick_lck);
! outlet_new(&x->x_gui.x_obj, &s_bang);
return x;
}
--- 123,159 ----
static void bng_tick_lck(t_bng *x) {x->x_gui.x_locked = 0;}
+ static void bng_reload(t_bng *x, int argc, t_atom *argv)
+ {
+ t_iemgui *y = (t_iemgui *)x;
+ y->x_binbufindex = 4;
+ y->x_labelbindex = 4+3;
+ int isa=0, ftbreak=250, fthold=50;
+ if (!pd_scanargs(argc,argv,"iiiiaaaiiiiccc",
+ &y->x_w,&fthold,&ftbreak,&isa,&y->x_snd,&y->x_rcv,&y->x_lab,
+ &y->x_ldx,&y->x_ldy,&y->x_font_style,&y->x_fontsize,
+ &y->x_bcol,&y->x_fcol,&y->x_lcol)) return;
+ iem_inttosymargs(y,isa);
+
+ y->x_h = y->x_w;
+ bng_check_minmax(x, ftbreak, fthold);
+ y->x_snd_able = y->x_snd!=sym_empty;
+ y->x_rcv_able = y->x_rcv!=sym_empty;
+ if (y->x_rcv_able) pd_bind((t_pd *)x, y->x_rcv);
+ iemgui_constrain(y);
+ }
+
static void *bng_new(t_symbol *s, int argc, t_atom *argv)
{
! t_iemgui *y = iemgui_new(bng_class);
! t_bng *x = (t_bng *)y;
! bng_check_minmax(x, 250, 50);
x->x_flashed = 0;
! y->x_draw = (t_iemfunptr)bng_draw;
! y->x_locked = 0;
x->x_clock_hld = clock_new(x, (t_method)bng_tick_hld);
x->x_clock_brk = clock_new(x, (t_method)bng_tick_brk);
x->x_clock_lck = clock_new(x, (t_method)bng_tick_lck);
! outlet_new((t_text *)x, &s_bang);
! bng_reload(x,argc,argv);
return x;
}
***************
*** 198,201 ****
--- 173,177 ----
t_class *c = bng_class = class_new(gensym("bng"), (t_newmethod)bng_new,
(t_method)bng_free, sizeof(t_bng), 0, A_GIMME, 0);
+ iemgui_subclass(c);
class_addbang(c, bng_bang);
class_addfloat(c, bng_float);
***************
*** 204,213 ****
class_addlist(c, bng_list);
class_addanything(c, bng_anything);
! 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);
wb.w_getrectfn = bng_getrect;
wb.w_displacefn = iemgui_displace;
--- 180,188 ----
class_addlist(c, bng_list);
class_addanything(c, bng_anything);
! class_addmethod(c, (t_method)bng_reload, gensym("reload"), 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);
wb.w_getrectfn = bng_getrect;
wb.w_displacefn = iemgui_displace;
***************
*** 217,223 ****
wb.w_visfn = iemgui_vis;
wb.w_clickfn = 0;
! class_setwidget(bng_class, &wb);
! class_sethelpsymbol(bng_class, gensym("bng"));
! class_setsavefn(bng_class, bng_save);
! class_setpropertiesfn(bng_class, bng_properties);
}
--- 192,197 ----
wb.w_visfn = iemgui_vis;
wb.w_clickfn = 0;
! class_setwidget(c, &wb);
! class_sethelpsymbol(c, gensym("bng"));
! class_setsavefn(c, bng_save);
}
Index: g_numbox.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v
retrieving revision 1.1.1.4.2.2.2.15
retrieving revision 1.1.1.4.2.2.2.16
diff -C2 -d -r1.1.1.4.2.2.2.15 -r1.1.1.4.2.2.2.16
*** g_numbox.c 3 May 2004 05:37:15 -0000 1.1.1.4.2.2.2.15
--- g_numbox.c 3 May 2004 17:03:29 -0000 1.1.1.4.2.2.2.16
***************
*** 30,60 ****
static void my_numbox_tick_reset(t_my_numbox *x)
{
! if(x->x_gui.x_change)
! {
! x->x_gui.x_change = 0; CH
! glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
! x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
! }
}
static void my_numbox_tick_wait(t_my_numbox *x)
! {
! x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
! }
void my_numbox_clip(t_my_numbox *x)
! {
! if(x->x_val < x->x_min) x->x_val = x->x_min;
! if(x->x_val > x->x_max) x->x_val = x->x_max;
! }
void my_numbox_calc_fontwidth(t_my_numbox *x)
{
! int w, f=31;
! if(x->x_gui.x_font_style == 1) f = 27;
! else if(x->x_gui.x_font_style == 2) f = 25;
! w = x->x_gui.x_fontsize * f * x->x_gui.x_w;
! w /= 36;
! x->x_numwidth = w + (x->x_gui.x_h / 2) + 4;
}
--- 30,50 ----
static void my_numbox_tick_reset(t_my_numbox *x)
{
! if(!x->x_gui.x_change) return;
! x->x_gui.x_change = 0; CH
! glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
! x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
}
static void my_numbox_tick_wait(t_my_numbox *x)
! {x->x_gui.x_draw(x, x->x_gui.x_glist, 0);}
void my_numbox_clip(t_my_numbox *x)
! {CLAMP(x->x_val,x->x_min,x->x_max);}
void my_numbox_calc_fontwidth(t_my_numbox *x)
{
! int f = x->x_gui.x_font_style==1 ? 27 : x->x_gui.x_font_style==2 ? 25 : 31;
! int w = x->x_gui.x_fontsize * f * x->x_gui.x_w / 36;
! x->x_numwidth = w + 4 + x->x_gui.x_h/2;
}
***************
*** 144,165 ****
t_symbol *srl[3];
iemgui_save(&x->x_gui, srl, bflcol);
! /*
! if(x->x_gui.x_change) {
! x->x_gui.x_change = 0; CH
! clock_unset(x->x_clock_reset);
! glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
! x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
!
! }
! */
! binbuf_addv(b, "ssiisiiffiisssiiiiiiifi", gensym("#X"),gensym("obj"),
! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix,
! gensym("nbx"), x->x_gui.x_w, x->x_gui.x_h,
! (float)x->x_min, (float)x->x_max,
! x->x_lin0_log1, iem_symargstoint(&x->x_gui),
! srl[0], srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy,
! x->x_gui.x_font_style, x->x_gui.x_fontsize,
! bflcol[0], bflcol[1], bflcol[2],
! x->x_val, x->x_log_height);
binbuf_addv(b, ";");
}
--- 134,144 ----
t_symbol *srl[3];
iemgui_save(&x->x_gui, srl, bflcol);
! binbuf_addv(b, "ssiisiiffiisssiiiiiiifi", gensym("#X"),gensym("obj"),
! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix,
! gensym("nbx"), x->x_gui.x_w, x->x_gui.x_h, x->x_min, x->x_max,
! x->x_gui.x_lin0_log1, iem_symargstoint(&x->x_gui),
! srl[0], srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy,
! x->x_gui.x_font_style, x->x_gui.x_fontsize,
! bflcol[0], bflcol[1], bflcol[2], x->x_val, x->x_log_height);
binbuf_addv(b, ";");
}
***************
*** 167,172 ****
int my_numbox_check_minmax(t_my_numbox *x, double min, double max)
{
! int ret=0;
! if(x->x_lin0_log1) {
if(min==0.0 && max==0.0) max = 1.0;
if(max > 0.0) {
--- 146,151 ----
int my_numbox_check_minmax(t_my_numbox *x, double min, double max)
{
! int val=x->x_val;
! if(x->x_gui.x_lin0_log1) {
if(min==0.0 && max==0.0) max = 1.0;
if(max > 0.0) {
***************
*** 178,203 ****
x->x_min = min;
x->x_max = max;
! if(x->x_val < x->x_min) { x->x_val = x->x_min; ret = 1; }
! if(x->x_val > x->x_max) { x->x_val = x->x_max; ret = 1; }
! x->x_k = x->x_lin0_log1 ? exp(log(x->x_max/x->x_min)/(double)(x->x_log_height)) : 1.0;
! return ret;
! }
!
! static void my_numbox_properties(t_gobj *z, t_glist *owner)
! {
! t_my_numbox *x = (t_my_numbox *)z;
! t_symbol *stub = gfxstub_new((t_pd *)x,x,0);
! t_symbol *srl[3];
!
! iemgui_properties(&x->x_gui, srl);
! if(x->x_gui.x_change) {
! x->x_gui.x_change = 0; CH
! clock_unset(x->x_clock_reset);
! glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
! x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
! }
! sys_vgui("pdtk_iemgui_dialog %s dimensions(digits)(pix): %d 1 width: %d 8 height: \
! output-range: %g min: %g max: 0 lin log log-height: %d %x\n",
! stub->s_name, x->x_gui.x_w, x->x_gui.x_h, x->x_min, x->x_max, x->x_log_height, x);
}
--- 157,163 ----
x->x_min = min;
x->x_max = max;
! CLAMP(x->x_val,x->x_min,x->x_max);
! x->x_k = x->x_gui.x_lin0_log1 ? exp(log(x->x_max/x->x_min)/(double)(x->x_log_height)) : 1.0;
! return x->x_val!=val;
}
***************
*** 209,237 ****
}
- static void my_numbox_dialog(t_my_numbox *x, t_symbol *s, int argc,
- t_atom *argv)
- {
- t_symbol *srl[3];
- int w = (int)atom_getintarg(0, argc, argv);
- int h = (int)atom_getintarg(1, argc, argv);
- double min = (double)atom_getfloatarg(2, argc, argv);
- double max = (double)atom_getfloatarg(3, argc, argv);
- int lilo = (int)atom_getintarg(4, argc, argv);
- int log_height = (int)atom_getintarg(6, argc, argv);
- x->x_lin0_log1 = !!lilo;
- iemgui_dialog(&x->x_gui, srl, argc, argv);
- x->x_gui.x_w = MAX(w,1);
- x->x_gui.x_h = MAX(h,8);
- x->x_log_height = MAX(log_height,10);
- my_numbox_calc_fontwidth(x);
- my_numbox_check_minmax(x, min, max);
- x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
- canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text *)x);
- }
-
static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy)
{
double k2= x->x_gui.x_finemoved ? 0.01 : 1.0;
! if(x->x_lin0_log1)
x->x_val *= pow(x->x_k, -k2*dy);
else
--- 169,176 ----
}
static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy)
{
double k2= x->x_gui.x_finemoved ? 0.01 : 1.0;
! if(x->x_gui.x_lin0_log1)
x->x_val *= pow(x->x_k, -k2*dy);
else
***************
*** 289,293 ****
if(lh < 10.0) lh = 10.0;
x->x_log_height = (int)lh;
! x->x_k = x->x_lin0_log1 ? exp(log(x->x_max/x->x_min)/(double)(x->x_log_height)) : 1.0;
}
--- 228,232 ----
if(lh < 10.0) lh = 10.0;
x->x_log_height = (int)lh;
! x->x_k = x->x_gui.x_lin0_log1 ? exp(log(x->x_max/x->x_min)/(double)(x->x_log_height)) : 1.0;
}
***************
*** 296,301 ****
{
my_numbox_set(x, f);
! if(x->x_gui.x_put_in2out)
! my_numbox_bang(x);
}
--- 235,239 ----
{
my_numbox_set(x, f);
! if(x->x_gui.x_put_in2out) my_numbox_bang(x);
}
***************
*** 316,329 ****
}
! static void my_numbox_log(t_my_numbox *x)
! {
! x->x_lin0_log1 = 1;
! if(my_numbox_check_minmax(x, x->x_min, x->x_max))
! x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
}
- static void my_numbox_lin(t_my_numbox *x)
- {x->x_lin0_log1 = 0;}
-
static void my_numbox_init(t_my_numbox *x, t_floatarg f) {x->x_gui.x_loadinit = !!f;}
static void my_numbox_loadbang(t_my_numbox *x)
--- 254,262 ----
}
! static void my_numbox_lin(t_my_numbox *x) {x->x_gui.x_lin0_log1 = 0;}
! static void my_numbox_log(t_my_numbox *x) {x->x_gui.x_lin0_log1 = 1;
! if(my_numbox_check_minmax(x, x->x_min, x->x_max)) x->x_gui.x_draw(x, x->x_gui.x_glist, 0);
}
static void my_numbox_init(t_my_numbox *x, t_floatarg f) {x->x_gui.x_loadinit = !!f;}
static void my_numbox_loadbang(t_my_numbox *x)
***************
*** 388,436 ****
}
! static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv)
{
! t_my_numbox *x = (t_my_numbox *)iemgui_new(my_numbox_class);
! int bflcol[]={-262144, -1, -1};
! int w=5, h=14;
! int isa=0, fstyle=0, fs=10;
! int lilo=0;
! int log_height=256;
! double min=-1.0e+37, max=1.0e+37,v=0.0;
! t_symbol *srl[3]={0,0,0};
!
! if(pd_scanargs(argc,argv,"iiddiiaaaiiiiiiid*",
! &w,&h,&min,&max,&lilo,&isa,&srl[0],&srl[1],&srl[2],
! &x->x_gui.x_ldx,&x->x_gui.x_ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2],&v))
! {
! iem_inttosymargs(&x->x_gui, isa);
! iemgui_new_getnames2(&x->x_gui, 6, srl[0], srl[1], srl[2]);
! }
! else iemgui_new_getnames(&x->x_gui, 6, 0);
! if((argc == 18)&&IS_A_FLOAT(argv,17))
! {
! log_height = (int)atom_getintarg(17, argc, argv);
! }
! x->x_gui.x_font_style = fstyle;
! x->x_gui.x_draw = (t_iemfunptr)my_numbox_draw;
! x->x_val = x->x_gui.x_loadinit ? v : 0.0;
! x->x_lin0_log1 = !!lilo;
! x->x_log_height = MAX(log_height,10);
! x->x_gui.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
! iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_font_style);
! if (x->x_gui.x_rcv_able) pd_bind((t_pd *)x, x->x_gui.x_rcv);
! x->x_gui.x_fontsize = MAX(fs,4);
! x->x_gui.x_w = MAX(w,1);
! x->x_gui.x_h = MAX(h,8);
! x->x_buf[0] = 0;
my_numbox_calc_fontwidth(x);
! my_numbox_check_minmax(x, min, max);
! iemgui_all_colfromload(&x->x_gui, bflcol);
! iemgui_verify_snd_ne_rcv(&x->x_gui);
x->x_clock_reset = clock_new(x, (t_method)my_numbox_tick_reset);
! x->x_clock_wait = clock_new(x, (t_method)my_numbox_tick_wait);
! x->x_gui.x_change = 0; CH
! outlet_new(&x->x_gui.x_obj, &s_float);
! return (x);
}
--- 321,363 ----
}
! static void my_numbox_reload(t_my_numbox *x, int argc, t_atom *argv)
{
! t_iemgui *y = (t_iemgui *)x;
! int isa=0, lilo=0;
! if(!pd_scanargs(argc,argv,"iiddbiaaaiiiicccd;i",
! &y->x_w,&y->x_h,&x->x_min,&x->x_max,&lilo,&isa,&y->x_snd,&y->x_rcv,&y->x_lab,
! &y->x_ldx,&y->x_ldy,&y->x_font_style,&y->x_fontsize,
! &y->x_bcol,&y->x_fcol,&y->x_lcol,&x->x_val,&x->x_log_height)) return;
! iem_inttosymargs(&x->x_gui, isa);
! y->x_lin0_log1 = lilo;
! if (!y->x_loadinit) x->x_val=0.0;
! iemgui_constrain(y);
my_numbox_calc_fontwidth(x);
! my_numbox_check_minmax(x, x->x_min, x->x_max);
! y->x_w = MAX(y->x_w,1);
! y->x_snd_able = y->x_snd!=sym_empty;
! y->x_rcv_able = y->x_rcv!=sym_empty;
! if (y->x_rcv_able) pd_bind((t_pd *)x, y->x_rcv);
! }
!
! static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv)
! {
! t_iemgui *y = iemgui_new(my_numbox_class);
! t_my_numbox *x = (t_my_numbox *)y;
! y->x_draw = (t_iemfunptr)my_numbox_draw;
! x->x_log_height = 256;
! y->x_w=5;
! y->x_h=14;
! x->x_min=-1.0e+37;
! x->x_max=1.0e+37;
! y->x_binbufindex = 6;
! y->x_labelbindex = 6+3;
! x->x_buf[0]=0;
x->x_clock_reset = clock_new(x, (t_method)my_numbox_tick_reset);
! x->x_clock_wait = clock_new(x, (t_method)my_numbox_tick_wait);
! y->x_change = 0; CH
! outlet_new((t_text *)x, &s_float);
! my_numbox_reload(x,argc,argv);
! return x;
}
***************
*** 448,466 ****
t_class *c = my_numbox_class = class_new(gensym("nbx"), (t_newmethod)my_numbox_new,
(t_method)my_numbox_free, sizeof(t_my_numbox), 0, A_GIMME, 0);
! class_addcreator((t_newmethod)my_numbox_new, gensym("my_numbox"),
! A_GIMME, 0);
class_addbang(c,my_numbox_bang);
class_addfloat(c,my_numbox_float);
class_addlist(c, my_numbox_list);
! class_addmethod(c, (t_method)my_numbox_click,
! gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(c, (t_method)my_numbox_motion,
! gensym("motion"), A_FLOAT, A_FLOAT, 0);
! class_addmethod(c, (t_method)my_numbox_dialog, gensym("dialog"), A_GIMME, 0);
class_addmethod(c, (t_method)my_numbox_loadbang, gensym("loadbang"), 0);
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);
--- 375,390 ----
t_class *c = my_numbox_class = class_new(gensym("nbx"), (t_newmethod)my_numbox_new,
(t_method)my_numbox_free, sizeof(t_my_numbox), 0, A_GIMME, 0);
! class_addcreator((t_newmethod)my_numbox_new, gensym("my_numbox"), A_GIMME, 0);
! iemgui_subclass(c);
class_addbang(c,my_numbox_bang);
class_addfloat(c,my_numbox_float);
class_addlist(c, my_numbox_list);
! class_addmethod(c, (t_method)my_numbox_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(c, (t_method)my_numbox_motion, gensym("motion"), A_FLOAT, A_FLOAT, 0);
! class_addmethod(c, (t_method)my_numbox_reload, gensym("reload"), A_GIMME, 0);
class_addmethod(c, (t_method)my_numbox_loadbang, gensym("loadbang"), 0);
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 */
class_addmethod(c, (t_method)my_numbox_log, gensym("log"), 0);
class_addmethod(c, (t_method)my_numbox_lin, gensym("lin"), 0);
***************
*** 477,480 ****
class_sethelpsymbol(c, gensym("numbox2"));
class_setsavefn(c, my_numbox_save);
- class_setpropertiesfn(c, my_numbox_properties);
}
--- 401,403 ----