From 64fdb009695828b788fce074135b20a5e52c5fc4 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 23 Sep 2003 00:21:28 +0000 Subject: imported version 0.37-0 svn path=/trunk/; revision=1016 --- pd/src/g_hdial.c | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) (limited to 'pd/src/g_hdial.c') diff --git a/pd/src/g_hdial.c b/pd/src/g_hdial.c index 1d1b4c6d..f7267c99 100644 --- a/pd/src/g_hdial.c +++ b/pd/src/g_hdial.c @@ -234,22 +234,20 @@ static void hradio_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *x static void hradio_save(t_gobj *z, t_binbuf *b) { t_hradio *x = (t_hradio *)z; - int bflcol[3], *ip1, *ip2; + int bflcol[3]; t_symbol *srl[3]; iemgui_save(&x->x_gui, srl, bflcol); - ip1 = (int *)(&x->x_gui.x_isa); - ip2 = (int *)(&x->x_gui.x_fsf); binbuf_addv(b, "ssiisiiiisssiiiiiiii", gensym("#X"),gensym("obj"), (t_int)text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist), (t_int)text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist), (pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class ? gensym("hdl") : gensym("hradio")), x->x_gui.x_w, - x->x_change, (*ip1)&IEM_INIT_ARGS_ALL, x->x_number, + x->x_change, iem_symargstoint(&x->x_gui.x_isa), x->x_number, srl[0], srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy, - (*ip2)&IEM_FSTYLE_FLAGS_ALL, x->x_gui.x_fontsize, + iem_fstyletoint(&x->x_gui.x_fsf), x->x_gui.x_fontsize, bflcol[0], bflcol[1], bflcol[2], x->x_on); binbuf_addv(b, ";"); } @@ -544,12 +542,12 @@ static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, int old) t_symbol *srl[3]; int a=IEM_GUI_DEFAULTSIZE, on=0, f=0; int ldx=0, ldy=-6, chg=1, num=8; - int fs=8, iinit=0, ifstyle=0; + int fs=8; int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold=IEM_BNG_DEFAULTHOLDFLASHTIME; - t_iem_init_symargs *init=(t_iem_init_symargs *)(&iinit); - t_iem_fstyle_flags *fstyle=(t_iem_fstyle_flags *)(&ifstyle); char str[144]; + iem_inttosymargs(&x->x_gui.x_isa, 0); + iem_inttofstyle(&x->x_gui.x_fsf, 0); srl[0] = gensym("empty"); srl[1] = gensym("empty"); srl[2] = gensym("empty"); @@ -565,7 +563,7 @@ 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); - iinit = (int)atom_getintarg(2, argc, argv); + iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(2, argc, argv)); num = (int)atom_getintarg(3, argc, argv); if(IS_A_SYMBOL(argv,4)) srl[0] = atom_getsymbolarg(4, argc, argv); @@ -590,7 +588,7 @@ static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, int old) } ldx = (int)atom_getintarg(7, argc, argv); ldy = (int)atom_getintarg(8, argc, argv); - ifstyle = (int)atom_getintarg(9, argc, argv); + iem_inttofstyle(&x->x_gui.x_fsf, 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); @@ -598,19 +596,15 @@ static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, int old) on = (int)atom_getintarg(14, argc, argv); } x->x_gui.x_draw = (t_iemfunptr)hradio_draw; - iinit &= IEM_INIT_ARGS_ALL; - ifstyle &= IEM_FSTYLE_FLAGS_ALL; - fstyle->x_snd_able = 1; - fstyle->x_rcv_able = 1; + x->x_gui.x_fsf.x_snd_able = 1; + x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); - x->x_gui.x_isa = *init; - if(!strcmp(srl[0]->s_name, "empty")) fstyle->x_snd_able = 0; - if(!strcmp(srl[1]->s_name, "empty")) fstyle->x_rcv_able = 0; - if(fstyle->x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); - else if(fstyle->x_font_style == 2) strcpy(x->x_gui.x_font, "times"); - else { fstyle->x_font_style = 0; + if(!strcmp(srl[0]->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; + if(!strcmp(srl[1]->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, "courier"); } - x->x_gui.x_fsf = *fstyle; x->x_gui.x_unique_num = 0; if(num < 1) num = 1; @@ -709,10 +703,10 @@ void g_hradio_setup(void) hradio_widgetbehavior.w_deletefn = iemgui_delete; hradio_widgetbehavior.w_visfn = iemgui_vis; hradio_widgetbehavior.w_clickfn = hradio_newclick; - hradio_widgetbehavior.w_propertiesfn = hradio_properties; - hradio_widgetbehavior.w_savefn = hradio_save; class_setwidget(hradio_class, &hradio_widgetbehavior); class_sethelpsymbol(hradio_class, gensym("hradio")); + class_setsavefn(hradio_class, hradio_save); + class_setpropertiesfn(hradio_class, hradio_properties); /*obsolete version (0.34-0.35) */ hradio_old_class = class_new(gensym("hdl"), (t_newmethod)hdial_new, @@ -759,5 +753,4 @@ void g_hradio_setup(void) gensym("double_change"), 0); class_setwidget(hradio_old_class, &hradio_widgetbehavior); class_sethelpsymbol(hradio_old_class, gensym("hradio")); - } -- cgit v1.2.1