Commit d49dbfcc authored by Mathieu L Bouchard's avatar Mathieu L Bouchard
Browse files

refactor : merge t_iem_fstyle_flags and t_iem_init_symargs into t_iemgui....

refactor : merge t_iem_fstyle_flags and t_iem_init_symargs into t_iemgui. remove type t_iemguidummy. remove fields x_rcv_able, x_snd_able and x_font. removed redundant arg "void *x" in 9 old g_all_guis.c functions. added dummy "send" method to [vu] for consistency.
parent 615a6d19
This diff is collapsed.
......@@ -111,17 +111,17 @@ void bng_draw_move(t_bng *x, t_glist *glist)
sys_vgui(".x%lx.c itemconfigure %lxBUT -fill #%6.6x -r %f\n",
canvas, x, x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, cr);
iemgui_label_draw_move(&x->x_gui,canvas,xpos,ypos);
if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist)
if(!iemgui_has_snd(&x->x_gui) && canvas == x->x_gui.x_glist)
sys_vgui(".x%lx.c coords %lxBNG%so%d %d %d %d %d\n",
canvas, x, nlet_tag, 0, xpos,
ypos + x->x_gui.x_h-1, xpos + IOWIDTH,
ypos + x->x_gui.x_h);
if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist)
if(!iemgui_has_rcv(&x->x_gui) && canvas == x->x_gui.x_glist)
sys_vgui(".x%lx.c coords %lxBNG%si%d %d %d %d %d\n",
canvas, x, nlet_tag, 0, xpos, ypos,
xpos + IOWIDTH, ypos+1);
/* redraw scale handle rectangle if selected */
if (x->x_gui.x_fsf.x_selected)
if (x->x_gui.x_selected)
bng_draw_select(x, x->x_gui.x_glist);
}
}
......@@ -141,7 +141,7 @@ void bng_draw_config(t_bng* x, t_glist* glist)
void bng_draw_select(t_bng* x, t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
if(x->x_gui.x_fsf.x_selected)
if(x->x_gui.x_selected)
{
/* check if we are drawing inside a gop abstraction visible
on parent canvas -- if so, disable highlighting */
......@@ -268,10 +268,10 @@ static void bng_save(t_gobj *z, t_binbuf *b)
(int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix,
gensym("bng"), x->x_gui.x_w,
x->x_flashtime_hold, x->x_flashtime_break,
iem_symargstoint(&x->x_gui.x_isa),
iem_symargstoint(&x->x_gui),
srl[0], srl[1], srl[2],
x->x_gui.x_ldx, x->x_gui.x_ldy,
iem_fstyletoint(&x->x_gui.x_fsf), x->x_gui.x_fontsize,
iem_fstyletoint(&x->x_gui), x->x_gui.x_fontsize,
bflcol[0], bflcol[1], bflcol[2]);
binbuf_addv(b, ";");
}
......@@ -311,10 +311,10 @@ static void bng_properties(t_gobj *z, t_glist *owner)
%d %d %d\n",
x->x_gui.x_w, IEM_GUI_MINSIZE,
x->x_flashtime_break, x->x_flashtime_hold, 2,/*min_max_schedule+clip*/
-1, x->x_gui.x_isa.x_loadinit, -1, -1,/*no linlog, no multi*/
-1, x->x_gui.x_loadinit, -1, -1,/*no linlog, no multi*/
srl[0]->s_name, srl[1]->s_name,
srl[2]->s_name, x->x_gui.x_ldx, x->x_gui.x_ldy,
x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize,
x->x_gui.x_font_style, x->x_gui.x_fontsize,
0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol);
gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf);
}
......@@ -338,32 +338,33 @@ static void bng_set(t_bng *x)
static void bng_bout1(t_bng *x)/*wird nur mehr gesendet, wenn snd != rcv*/
{
if(!x->x_gui.x_fsf.x_put_in2out)
fprintf(stderr,"bng_bout1: snd=%s rcv=%s\n",x->x_gui.x_snd->s_name,x->x_gui.x_rcv->s_name);
if(!x->x_gui.x_put_in2out)
{
x->x_gui.x_isa.x_locked = 1;
x->x_gui.x_locked = 1;
clock_delay(x->x_clock_lck, 2);
}
outlet_bang(x->x_gui.x_obj.ob_outlet);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing &&
x->x_gui.x_fsf.x_put_in2out)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing &&
x->x_gui.x_put_in2out)
pd_bang(x->x_gui.x_snd->s_thing);
}
static void bng_bout2(t_bng *x)/*wird immer gesendet, wenn moeglich*/
{
if(!x->x_gui.x_fsf.x_put_in2out)
if(!x->x_gui.x_put_in2out)
{
x->x_gui.x_isa.x_locked = 1;
x->x_gui.x_locked = 1;
clock_delay(x->x_clock_lck, 2);
}
outlet_bang(x->x_gui.x_obj.ob_outlet);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_bang(x->x_gui.x_snd->s_thing);
}
static void bng_bang(t_bng *x)/*wird nur mehr gesendet, wenn snd != rcv*/
{
if(!x->x_gui.x_isa.x_locked)
if(!x->x_gui.x_locked)
{
bng_set(x);
bng_bout1(x);
......@@ -372,7 +373,7 @@ static void bng_bang(t_bng *x)/*wird nur mehr gesendet, wenn snd != rcv*/
static void bng_bang2(t_bng *x)/*wird immer gesendet, wenn moeglich*/
{
if(!x->x_gui.x_isa.x_locked)
if(!x->x_gui.x_locked)
{
bng_set(x);
bng_bout2(x);
......@@ -396,10 +397,10 @@ static void bng_dialog(t_bng *x, t_symbol *s, int argc, t_atom *argv)
(*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);
iemgui_shouldvis((void *)x, &x->x_gui, IEM_GUI_DRAW_MODE_MOVE);
iemgui_shouldvis(&x->x_gui, IEM_GUI_DRAW_MODE_MOVE);
/* forcing redraw of the scale handle */
if (x->x_gui.x_fsf.x_selected)
if (x->x_gui.x_selected)
{
bng_draw_select(x, x->x_gui.x_glist);
}
......@@ -445,7 +446,7 @@ static void bng_anything(t_bng *x, t_symbol *s, int argc, t_atom *argv)
static void bng_loadbang(t_bng *x)
{
if(!sys_noloadbang && x->x_gui.x_isa.x_loadinit)
if(!sys_noloadbang && x->x_gui.x_loadinit)
{
bng_set(x);
bng_bout2(x);
......@@ -456,42 +457,18 @@ static void bng_size(t_bng *x, t_symbol *s, int ac, t_atom *av)
{
x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
x->x_gui.x_h = x->x_gui.x_w;
iemgui_size((void *)x, &x->x_gui);
iemgui_size(&x->x_gui);
}
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_flashtime(t_bng *x, t_symbol *s, int ac, t_atom *av)
{
bng_check_minmax(x, (int)atom_getintarg(0, ac, av),
(int)atom_getintarg(1, 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;
x->x_gui.x_loadinit = (f==0.0)?0:1;
}
static void bng_tick_hld(t_bng *x)
......@@ -507,7 +484,7 @@ static void bng_tick_brk(t_bng *x)
static void bng_tick_lck(t_bng *x)
{
x->x_gui.x_isa.x_locked = 0;
x->x_gui.x_locked = 0;
}
static void *bng_new(t_symbol *s, int argc, t_atom *argv)
......@@ -520,8 +497,8 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME,
fthold=IEM_BNG_DEFAULTHOLDFLASHTIME;
iem_inttosymargs(&x->x_gui.x_isa, 0);
iem_inttofstyle(&x->x_gui.x_fsf, 0);
iem_inttosymargs(&x->x_gui, 0);
iem_inttofstyle(&x->x_gui, 0);
if((argc == 14)&&IS_A_FLOAT(argv,0)
&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2)
......@@ -537,11 +514,11 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
a = (int)atom_getintarg(0, argc, argv);
fthold = (int)atom_getintarg(1, argc, argv);
ftbreak = (int)atom_getintarg(2, argc, argv);
iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(3, argc, argv));
iem_inttosymargs(&x->x_gui, atom_getintarg(3, argc, argv));
iemgui_new_getnames(&x->x_gui, 4, argv);
ldx = (int)atom_getintarg(7, argc, argv);
ldy = (int)atom_getintarg(8, argc, argv);
iem_inttofstyle(&x->x_gui.x_fsf, atom_getintarg(9, argc, argv));
iem_inttofstyle(&x->x_gui, atom_getintarg(9, argc, argv));
fs = (int)atom_getintarg(10, argc, argv);
bflcol[0] = (int)atom_getintarg(11, argc, argv);
bflcol[1] = (int)atom_getintarg(12, argc, argv);
......@@ -551,25 +528,10 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_draw = (t_iemfunptr)bng_draw;
x->x_gui.x_fsf.x_snd_able = 1;
x->x_gui.x_fsf.x_rcv_able = 1;
x->x_flashed = 0;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
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");
else
{
x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, sys_font);
}
if (x->x_gui.x_fsf.x_rcv_able)
if (x->x_gui.x_font_style<0 || x->x_gui.x_font_style>2) x->x_gui.x_font_style=0;
if (iemgui_has_rcv(&x->x_gui))
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;
......@@ -581,7 +543,7 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_h = x->x_gui.x_w;
bng_check_minmax(x, ftbreak, fthold);
iemgui_all_colfromload(&x->x_gui, bflcol);
x->x_gui.x_isa.x_locked = 0;
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);
......@@ -598,7 +560,7 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
static void bng_ff(t_bng *x)
{
if(x->x_gui.x_fsf.x_rcv_able)
if(iemgui_has_rcv(&x->x_gui))
pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
clock_free(x->x_clock_lck);
clock_free(x->x_clock_brk);
......@@ -625,22 +587,9 @@ void g_bang_setup(void)
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);
iemgui_class_addmethods(bng_class);
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);
scalehandle_class = class_new(gensym("_scalehandle"), 0, 0,
......@@ -655,6 +604,4 @@ void g_bang_setup(void)
class_sethelpsymbol(bng_class, gensym("bng"));
class_setsavefn(bng_class, bng_save);
class_setpropertiesfn(bng_class, bng_properties);
s_empty = gensym("empty");
}
......@@ -123,14 +123,14 @@ void hradio_draw_move(t_hradio *x, t_glist *glist)
xx22 += dx;
}
iemgui_label_draw_move(&x->x_gui,canvas,xx11b,yy11);
if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist)
if(!iemgui_has_snd(&x->x_gui) && canvas == x->x_gui.x_glist)
sys_vgui(".x%lx.c coords %lxHRDO%so%d %d %d %d %d\n",
canvas, x, nlet_tag, 0, xx11b, yy12-1, xx11b + IOWIDTH, yy12);
if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist)
if(!iemgui_has_rcv(&x->x_gui) && canvas == x->x_gui.x_glist)
sys_vgui(".x%lx.c coords %lxHRDO%si%d %d %d %d %d\n",
canvas, x, nlet_tag, 0, xx11b, yy11, xx11b + IOWIDTH, yy11+1);
/* redraw scale handle rectangle if selected */
if (x->x_gui.x_fsf.x_selected)
if (x->x_gui.x_selected)
hradio_draw_select(x, x->x_gui.x_glist);
}
}
......@@ -158,7 +158,7 @@ void hradio_draw_config(t_hradio* x, t_glist* glist)
void hradio_draw_select(t_hradio* x, t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
if(x->x_gui.x_fsf.x_selected)
if(x->x_gui.x_selected)
{
// check if we are drawing inside a gop abstraction
// visible on parent canvas. If so, disable highlighting
......@@ -285,10 +285,10 @@ static void hradio_save(t_gobj *z, t_binbuf *b)
(pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class ?
gensym("hdl") : gensym("hradio")),
x->x_gui.x_w,
x->x_change, iem_symargstoint(&x->x_gui.x_isa), x->x_number,
x->x_change, iem_symargstoint(&x->x_gui), x->x_number,
srl[0], srl[1], srl[2],
x->x_gui.x_ldx, x->x_gui.x_ldy,
iem_fstyletoint(&x->x_gui.x_fsf), x->x_gui.x_fontsize,
iem_fstyletoint(&x->x_gui), x->x_gui.x_fontsize,
bflcol[0], bflcol[1], bflcol[2], x->x_on);
binbuf_addv(b, ";");
}
......@@ -313,10 +313,10 @@ static void hradio_properties(t_gobj *z, t_glist *owner)
%d %d %d\n",
x->x_gui.x_w, IEM_GUI_MINSIZE,
0,/*no_schedule*/
hchange, x->x_gui.x_isa.x_loadinit, -1, x->x_number,
hchange, x->x_gui.x_loadinit, -1, x->x_number,
srl[0]->s_name, srl[1]->s_name,
srl[2]->s_name, x->x_gui.x_ldx, x->x_gui.x_ldy,
x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize,
x->x_gui.x_font_style, x->x_gui.x_fontsize,
0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol,
0xffffff & x->x_gui.x_lcol);
gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf);
......@@ -354,11 +354,11 @@ static void hradio_dialog(t_hradio *x, t_symbol *s, int argc, t_atom *argv)
(*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);
iemgui_shouldvis((void *)x, &x->x_gui, IEM_GUI_DRAW_MODE_MOVE);
iemgui_shouldvis(&x->x_gui, IEM_GUI_DRAW_MODE_MOVE);
}
/* forcing redraw of the scale handle */
if (x->x_gui.x_fsf.x_selected)
if (x->x_gui.x_selected)
{
hradio_draw_select(x, x->x_gui.x_glist);
}
......@@ -405,20 +405,20 @@ static void hradio_bang(t_hradio *x)
SETFLOAT(x->x_at, (t_float)x->x_on_old);
SETFLOAT(x->x_at+1, 0.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_list(x->x_gui.x_snd->s_thing, &s_list, 2, x->x_at);
}
x->x_on_old = x->x_on;
SETFLOAT(x->x_at, (t_float)x->x_on);
SETFLOAT(x->x_at+1, 1.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_list(x->x_gui.x_snd->s_thing, &s_list, 2, x->x_at);
}
else
{
outlet_float(x->x_gui.x_obj.ob_outlet, x->x_on);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_float(x->x_gui.x_snd->s_thing, x->x_on);
}
}
......@@ -439,7 +439,7 @@ static void hradio_fout(t_hradio *x, t_floatarg f)
SETFLOAT(x->x_at, (t_float)x->x_on_old);
SETFLOAT(x->x_at+1, 0.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_list(x->x_gui.x_snd->s_thing, &s_list, 2, x->x_at);
}
if(x->x_on != x->x_on_old)
......@@ -450,7 +450,7 @@ static void hradio_fout(t_hradio *x, t_floatarg f)
SETFLOAT(x->x_at, (t_float)x->x_on);
SETFLOAT(x->x_at+1, 1.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_list(x->x_gui.x_snd->s_thing, &s_list, 2, x->x_at);
}
else
......@@ -460,7 +460,7 @@ static void hradio_fout(t_hradio *x, t_floatarg f)
if (i != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
outlet_float(x->x_gui.x_obj.ob_outlet, x->x_on);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_float(x->x_gui.x_snd->s_thing, x->x_on);
}
}
......@@ -479,12 +479,12 @@ static void hradio_float(t_hradio *x, t_floatarg f)
/* compatibility with earlier "vdial" behavior */
if((x->x_change)&&(i != x->x_on_old))
{
if(x->x_gui.x_fsf.x_put_in2out)
if(x->x_gui.x_put_in2out)
{
SETFLOAT(x->x_at, (t_float)x->x_on_old);
SETFLOAT(x->x_at+1, 0.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_list(x->x_gui.x_snd->s_thing, &s_list, 2, x->x_at);
}
}
......@@ -493,12 +493,12 @@ static void hradio_float(t_hradio *x, t_floatarg f)
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
x->x_on_old = x->x_on;
if(x->x_gui.x_fsf.x_put_in2out)
if(x->x_gui.x_put_in2out)
{
SETFLOAT(x->x_at, (t_float)x->x_on);
SETFLOAT(x->x_at+1, 1.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_list(x->x_gui.x_snd->s_thing, &s_list, 2, x->x_at);
}
}
......@@ -508,10 +508,10 @@ static void hradio_float(t_hradio *x, t_floatarg f)
x->x_on = i;
if (i != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_gui.x_fsf.x_put_in2out)
if (x->x_gui.x_put_in2out)
{
outlet_float(x->x_gui.x_obj.ob_outlet, x->x_on);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
if(iemgui_has_snd(&x->x_gui) && x->x_gui.x_snd->s_thing)
pd_float(x->x_gui.x_snd->s_thing, x->x_on);
}
}
......@@ -538,7 +538,7 @@ static int hradio_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix,
static void hradio_loadbang(t_hradio *x)
{
if(!sys_noloadbang && x->x_gui.x_isa.x_loadinit)
if(!sys_noloadbang && x->x_gui.x_loadinit)
hradio_bang(x);
}
......@@ -565,36 +565,12 @@ static void hradio_size(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{
x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
x->x_gui.x_h = x->x_gui.x_w;
iemgui_size((void *)x, &x->x_gui);
iemgui_size(&x->x_gui);
}
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;
x->x_gui.x_loadinit = (f==0.0)?0:1;
}
static void hradio_double_change(t_hradio *x)
......@@ -611,8 +587,8 @@ static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, int old)
int ldx=0, ldy=-8, chg=1, num=8;
int fs=10;
iem_inttosymargs(&x->x_gui.x_isa, 0);
iem_inttofstyle(&x->x_gui.x_fsf, 0);
iem_inttosymargs(&x->x_gui, 0);
iem_inttofstyle(&x->x_gui, 0);
if((argc == 15)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2)
&&IS_A_FLOAT(argv,3)
......@@ -625,12 +601,12 @@ static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, int old)
{
a = (int)atom_getintarg(0, argc, argv);
chg = (int)atom_getintarg(1, argc, argv);
iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(2, argc, argv));
iem_inttosymargs(&x->x_gui, atom_getintarg(2, argc, argv));
num = (int)atom_getintarg(3, argc, argv);
iemgui_new_getnames(&x->x_gui, 4, argv);
ldx = (int)atom_getintarg(7, argc, argv);
ldy = (int)atom_getintarg(8, argc, argv);
iem_inttofstyle(&x->x_gui.x_fsf, atom_getintarg(9, argc, argv));
iem_inttofstyle(&x->x_gui, atom_getintarg(9, argc, argv));
fs = (int)atom_getintarg(10, argc, argv);
bflcol[0] = (int)atom_getintarg(11, argc, argv);
bflcol[1] = (int)atom_getintarg(12, argc, argv);
......@@ -639,22 +615,8 @@ static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, int old)
}
else iemgui_new_getnames(&x->x_gui, 4, 0);
x->x_gui.x_draw = (t_iemfunptr)hradio_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();
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");
else
{
x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, sys_font);
}
if (x->x_gui.x_font_style<0 || x->x_gui.x_font_style>2) x->x_gui.x_font_style=0;
if(num < 1)
num = 1;
if(num > IEM_RADIO_MAX)
......@@ -664,13 +626,13 @@ static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, int old)
on = 0;
if(on >= x->x_number)
on = x->x_number - 1;
if(x->x_gui.x_isa.x_loadinit)
if(x->x_gui.x_loadinit)
x->x_on = on;
else
x->x_on = 0;
x->x_on_old = x->x_on;
x->x_change = (chg==0)?0:1;
if (x->x_gui.x_fsf.x_rcv_able)
if (iemgui_has_rcv(&x->x_gui))
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;
......@@ -702,7 +664,7 @@ static void *hdial_new(t_symbol *s, int argc, t_atom *argv)
static void hradio_ff(t_hradio *x)
{
if(x->x_gui.x_fsf.x_rcv_able)
if(iemgui_has_rcv(&x->x_gui))
pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
gfxstub_deleteforkey(x);
......@@ -726,22 +688,7 @@ void g_hradio_setup(void)
gensym("set"), A_FLOAT, 0);
class_addmethod(hradio_class, (t_method)hradio_size,
gensym("size"), A_GIMME, 0);
class_addmethod(hradio_class, (t_method)hradio_delta,
gensym("delta"), A_GIMME, 0);
class_addmethod(hradio_class, (t_method)hradio_pos,
gensym("pos"), A_GIMME, 0);
class_addmethod(hradio_class, (t_method)hradio_color,
gensym("color"), A_GIMME, 0);
class_addmethod(hradio_class, (t_method)hradio_send,
gensym("send"), A_DEFSYM, 0);
class_addmethod(hradio_class, (t_method)hradio_receive,
gensym("receive"), A_DEFSYM, 0);
class_addmethod(hradio_class, (t_method)hradio_label,
gensym("label"), A_DEFSYM, 0);
class_addmethod(hradio_class, (t_method)hradio_label_pos,
gensym("label_pos"), A_GIMME, 0);
class_addmethod(hradio_class, (t_method)hradio_label_font,