Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3137
Modified Files: Tag: impd_0_37 g_all_guis.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 g_all_guis.h Log Message: cleanup (nuked x_labelbindex, etc)
Index: g_dropper.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/g_dropper.c,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -C2 -d -r1.1.2.11 -r1.1.2.12 *** g_dropper.c 3 May 2004 17:03:28 -0000 1.1.2.11 --- g_dropper.c 3 May 2004 21:18:38 -0000 1.1.2.12 *************** *** 48,55 **** { t_dropper *x = (t_dropper *)z; ! int bflcol[3]; t_symbol *srl[3]; ! ! iemgui_save(&x->x_gui, srl, bflcol); binbuf_addv(b, "ssiisiisssiiiiiii", gensym("#X"),gensym("obj"), (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix, --- 48,54 ---- { t_dropper *x = (t_dropper *)z; ! t_iemgui *y = (t_iemgui *)x; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl,0); binbuf_addv(b, "ssiisiisssiiiiiii", gensym("#X"),gensym("obj"), (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix, *************** *** 59,63 **** 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]); binbuf_addv(b, ";"); } --- 58,62 ---- x->x_gui.x_ldx, x->x_gui.x_ldy, x->x_gui.x_font_style, x->x_gui.x_fontsize, ! convert_color2(y->x_bcol), convert_color2(y->x_fcol), convert_color2(y->x_lcol)); binbuf_addv(b, ";"); }
Index: g_toggle.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_toggle.c,v retrieving revision 1.1.1.3.2.2.2.17 retrieving revision 1.1.1.3.2.2.2.18 diff -C2 -d -r1.1.1.3.2.2.2.17 -r1.1.1.3.2.2.2.18 *** g_toggle.c 3 May 2004 17:03:29 -0000 1.1.1.3.2.2.2.17 --- g_toggle.c 3 May 2004 21:18:39 -0000 1.1.1.3.2.2.2.18 *************** *** 50,56 **** { t_toggle *x = (t_toggle *)z; ! int bflcol[3]; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, bflcol); binbuf_addv(b, "ssiisiisssiiiiiiiff", gensym("#X"),gensym("obj"), (t_int)x->x_gui.x_obj.te_xpix, --- 50,56 ---- { t_toggle *x = (t_toggle *)z; ! t_iemgui *y = (t_iemgui *)x; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, 0); binbuf_addv(b, "ssiisiisssiiiiiiiff", gensym("#X"),gensym("obj"), (t_int)x->x_gui.x_obj.te_xpix, *************** *** 59,63 **** 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_on, x->x_nonzero); binbuf_addv(b, ";"); } --- 59,64 ---- 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, ! convert_color2(y->x_bcol), convert_color2(y->x_fcol), convert_color2(y->x_lcol), ! x->x_on, x->x_nonzero); binbuf_addv(b, ";"); } *************** *** 127,131 **** 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); --- 128,131 ----
Index: g_hdial.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v retrieving revision 1.1.1.4.2.2.2.19 retrieving revision 1.1.1.4.2.2.2.20 diff -C2 -d -r1.1.1.4.2.2.2.19 -r1.1.1.4.2.2.2.20 *** g_hdial.c 3 May 2004 17:03:28 -0000 1.1.1.4.2.2.2.19 --- g_hdial.c 3 May 2004 21:18:38 -0000 1.1.1.4.2.2.2.20 *************** *** 59,73 **** { t_radio *x = (t_radio *)z; ! int bflcol[3]; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, bflcol); binbuf_addv(b, "ssiisiiiisssiiiiiiii", gensym("#X"),gensym("obj"), ! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix, ! x->x_flavor, x->x_gui.x_w, ! 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, ! x->x_gui.x_font_style, x->x_gui.x_fontsize, ! bflcol[0], bflcol[1], bflcol[2], x->x_on); binbuf_addv(b, ";"); } --- 59,74 ---- { t_radio *x = (t_radio *)z; ! t_iemgui *y = (t_iemgui *)x; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, 0); binbuf_addv(b, "ssiisiiiisssiiiiiiii", gensym("#X"),gensym("obj"), ! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix, ! x->x_flavor, x->x_gui.x_w, ! 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, ! x->x_gui.x_font_style, x->x_gui.x_fontsize, ! convert_color2(y->x_bcol), convert_color2(y->x_fcol), convert_color2(y->x_lcol), ! x->x_on); binbuf_addv(b, ";"); } *************** *** 247,251 **** 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); --- 248,251 ----
Index: g_vumeter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_vumeter.c,v retrieving revision 1.1.1.3.2.2.2.15 retrieving revision 1.1.1.3.2.2.2.16 diff -C2 -d -r1.1.1.3.2.2.2.15 -r1.1.1.3.2.2.2.16 *** g_vumeter.c 3 May 2004 17:03:29 -0000 1.1.1.3.2.2.2.15 --- g_vumeter.c 3 May 2004 21:18:39 -0000 1.1.1.3.2.2.2.16 *************** *** 87,102 **** { t_vu *x = (t_vu *)z; ! int bflcol[3]; t_symbol *srl[3]; ! ! iemgui_save(&x->x_gui, srl, bflcol); binbuf_addv(b, "ssiisiissiiiiiiii", gensym("#X"),gensym("obj"), ! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix, ! gensym("vu"), x->x_gui.x_w, x->x_gui.x_h, ! 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[2], x->x_scale, ! iem_symargstoint(&x->x_gui)); binbuf_addv(b, ";"); } --- 87,102 ---- { t_vu *x = (t_vu *)z; ! t_iemgui *y = (t_iemgui *)x; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, 0); binbuf_addv(b, "ssiisiissiiiiiiii", gensym("#X"),gensym("obj"), ! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix, ! gensym("vu"), x->x_gui.x_w, x->x_gui.x_h, ! 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, ! convert_color2(y->x_bcol), convert_color2(y->x_lcol), ! x->x_scale, ! iem_symargstoint(&x->x_gui)); binbuf_addv(b, ";"); } *************** *** 184,188 **** 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")); --- 184,187 ----
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.24 retrieving revision 1.1.1.4.2.4.2.25 diff -C2 -d -r1.1.1.4.2.4.2.24 -r1.1.1.4.2.4.2.25 *** g_all_guis.c 3 May 2004 17:03:28 -0000 1.1.1.4.2.4.2.24 --- g_all_guis.c 3 May 2004 21:18:38 -0000 1.1.1.4.2.4.2.25 *************** *** 98,110 ****
/* convert symbols in "$" form to the expanded symbols */ ! static void iemgui_all_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym) { /* save unexpanded ones for later */ ! iemgui->x_snd_unexpanded = srlsym[0]; ! iemgui->x_rcv_unexpanded = srlsym[1]; ! iemgui->x_lab_unexpanded = srlsym[2]; ! srlsym[0] = canvas_realizedollar(iemgui->x_glist, srlsym[0]); ! srlsym[1] = canvas_realizedollar(iemgui->x_glist, srlsym[1]); ! srlsym[2] = canvas_realizedollar(iemgui->x_glist, srlsym[2]); }
--- 98,107 ----
/* convert symbols in "$" form to the expanded symbols */ ! static void iemgui_all_dollararg2sym(t_iemgui *x, t_symbol **sym) { /* save unexpanded ones for later */ ! x->x_snd_unexpanded = sym[0]; sym[0] = canvas_realizedollar(x->x_glist, sym[0]); ! x->x_rcv_unexpanded = sym[1]; sym[1] = canvas_realizedollar(x->x_glist, sym[1]); ! x->x_lab_unexpanded = sym[2]; sym[2] = canvas_realizedollar(x->x_glist, sym[2]); }
*************** *** 112,155 **** binbuf to grab them; if there's nothing there, set it to the fallback; if still nothing, set to "empty". */ ! static void iemgui_init_sym2dollararg(t_iemgui *iemgui, t_symbol **symp, ! int indx, t_symbol *fallback) { ! if (!*symp) ! { ! t_binbuf *b = iemgui->x_obj.ob_binbuf; ! if (binbuf_getnatom(b) > indx) ! { ! char buf[80]; ! atom_string(binbuf_getvec(b) + indx, buf, 80); ! *symp = gensym(buf); ! } ! else if (fallback) ! *symp = fallback; ! else *symp = gensym("empty"); ! } }
/* get the unexpanded versions of the symbols; initialize them if necessary. */ ! static void iemgui_all_sym2dollararg(t_iemgui *iemgui, t_symbol **srlsym) ! { ! iemgui_init_sym2dollararg(iemgui, &iemgui->x_snd_unexpanded, iemgui->x_binbufindex+1, iemgui->x_snd); ! iemgui_init_sym2dollararg(iemgui, &iemgui->x_rcv_unexpanded, iemgui->x_binbufindex+2, iemgui->x_rcv); ! iemgui_init_sym2dollararg(iemgui, &iemgui->x_lab_unexpanded, iemgui->x_labelbindex, iemgui->x_lab); ! srlsym[0] = iemgui->x_snd_unexpanded; ! srlsym[1] = iemgui->x_rcv_unexpanded; ! srlsym[2] = iemgui->x_lab_unexpanded; }
! static int convert_color2(int x) { return ~ (((0xfc0000&x)>>6) | ((0xfc00&x)>>4) | ((0xfc&x)>>2)); }
- void iemgui_all_col2save(t_iemgui *iemgui, int *bflcol) - { - bflcol[0] = convert_color2(iemgui->x_bcol); - bflcol[1] = convert_color2(iemgui->x_fcol); - bflcol[2] = convert_color2(iemgui->x_lcol); - } - static int convert_color(int x) { if (x>=0) return iemgui_color_hex[x%IEM_GUI_MAX_COLOR]; --- 109,136 ---- binbuf to grab them; if there's nothing there, set it to the fallback; if still nothing, set to "empty". */ ! static void sym2dollararg(t_iemgui *x, t_symbol **symp, int indx, t_symbol *fallback) { ! t_binbuf *b = x->x_obj.ob_binbuf; ! if (*symp) return; ! if (binbuf_getnatom(b) > indx) { ! char buf[80]; ! atom_string(binbuf_getvec(b) + indx, buf, 80); ! *symp = gensym(buf); ! } else if (fallback) *symp = fallback; ! else *symp = gensym("empty"); }
/* get the unexpanded versions of the symbols; initialize them if necessary. */ ! static void iemgui_all_sym2dollararg(t_iemgui *x, t_symbol **sym) { ! int i=x->x_binbufindex; ! sym2dollararg(x, &x->x_snd_unexpanded, i+1, x->x_snd); sym[0] = x->x_snd_unexpanded; ! sym2dollararg(x, &x->x_rcv_unexpanded, i+2, x->x_rcv); sym[1] = x->x_rcv_unexpanded; ! sym2dollararg(x, &x->x_lab_unexpanded, i+3, x->x_lab); sym[2] = x->x_lab_unexpanded; }
! int convert_color2(int x) { return ~ (((0xfc0000&x)>>6) | ((0xfc00&x)>>4) | ((0xfc&x)>>2)); }
static int convert_color(int x) { if (x>=0) return iemgui_color_hex[x%IEM_GUI_MAX_COLOR]; *************** *** 165,258 **** }
! void iemgui_send(t_iemgui *iemgui, t_symbol *s) { t_symbol *snd = iemgui_raute2dollar(s); ! iemgui->x_snd_unexpanded = snd; ! iemgui->x_snd = canvas_realizedollar(iemgui->x_glist, snd); ! post("send: before %s, after %s", iemgui->x_snd_unexpanded->s_name, iemgui->x_snd->s_name); ! iemgui->x_snd_able = strcmp(s->s_name, "empty"); ! iemgui_verify_snd_ne_rcv(iemgui); ! iemgui->x_draw(iemgui, iemgui->x_glist, 0); }
! void iemgui_receive(t_iemgui *iemgui, t_symbol *s) { t_symbol *rcv = iemgui_raute2dollar(s); int rcvable = !!strcmp(s->s_name, "empty"); ! iemgui->x_rcv_unexpanded = rcv; ! iemgui->x_rcv = rcv = canvas_realizedollar(iemgui->x_glist, rcv); ! if(rcvable) ! { ! if(strcmp(rcv->s_name, iemgui->x_rcv->s_name)) ! { ! if(iemgui->x_rcv_able) ! pd_unbind(&iemgui->x_obj.ob_pd, iemgui->x_rcv); ! iemgui->x_rcv = rcv; ! pd_bind(&iemgui->x_obj.ob_pd, iemgui->x_rcv); } } ! else if(!rcvable && iemgui->x_rcv_able) ! { ! pd_unbind(&iemgui->x_obj.ob_pd, iemgui->x_rcv); ! iemgui->x_rcv = rcv; ! } ! iemgui->x_rcv_able = rcvable; ! iemgui_verify_snd_ne_rcv(iemgui); ! iemgui->x_draw(iemgui, iemgui->x_glist, 0); }
! void iemgui_label(t_iemgui *iemgui, t_symbol *s) { t_symbol *lab = iemgui_raute2dollar(s); ! iemgui->x_lab_unexpanded = lab; ! iemgui->x_lab = lab = canvas_realizedollar(iemgui->x_glist, lab); ! if(glist_isvisible(iemgui->x_glist)) iemgui->x_draw(iemgui,iemgui->x_glist,0); }
! void iemgui_label_pos(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) ! { ! iemgui->x_ldx = (int)atom_getintarg(0, ac, av); ! iemgui->x_ldy = (int)atom_getintarg(1, ac, av); ! if(glist_isvisible(iemgui->x_glist)) ! iemgui->x_draw(iemgui, iemgui->x_glist, 0); }
! void iemgui_label_font(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) { 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); }
! void iemgui_size(t_iemgui *iemgui) ! { ! if(glist_isvisible(iemgui->x_glist)) ! { ! iemgui->x_draw(iemgui, iemgui->x_glist, 0); ! canvas_fixlinesfor(glist_getcanvas(iemgui->x_glist), (t_text*)iemgui); } }
! void iemgui_delta(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) { ! iemgui->x_obj.te_xpix += (int)atom_getintarg(0, ac, av); ! iemgui->x_obj.te_ypix += (int)atom_getintarg(1, ac, av); ! if(glist_isvisible(iemgui->x_glist)) ! { ! iemgui->x_draw(iemgui, iemgui->x_glist, 0); ! canvas_fixlinesfor(glist_getcanvas(iemgui->x_glist), (t_text*)iemgui); ! } }
! void iemgui_pos(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) { ! iemgui->x_obj.te_xpix = (int)atom_getintarg(0, ac, av); ! iemgui->x_obj.te_ypix = (int)atom_getintarg(1, ac, av); ! if(glist_isvisible(iemgui->x_glist)) ! { ! iemgui->x_draw(iemgui, iemgui->x_glist, 0); ! canvas_fixlinesfor(glist_getcanvas(iemgui->x_glist), (t_text*)iemgui); ! } }
--- 146,222 ---- }
! void iemgui_send(t_iemgui *x, t_symbol *s) { t_symbol *snd = iemgui_raute2dollar(s); ! x->x_snd_unexpanded = snd; ! x->x_snd = canvas_realizedollar(x->x_glist, snd); ! //post("send: before %s, after %s", x->x_snd_unexpanded->s_name, x->x_snd->s_name); ! x->x_snd_able = strcmp(s->s_name, "empty"); ! iemgui_verify_snd_ne_rcv(x); ! x->x_draw(x,x->x_glist, 0); }
! void iemgui_receive(t_iemgui *x, t_symbol *s) { t_symbol *rcv = iemgui_raute2dollar(s); int rcvable = !!strcmp(s->s_name, "empty"); ! x->x_rcv_unexpanded = rcv; ! x->x_rcv = rcv = canvas_realizedollar(x->x_glist, rcv); ! if(rcvable) { ! if(rcv!=x->x_rcv) { ! if(x->x_rcv_able) pd_unbind((t_pd *)x, x->x_rcv); ! x->x_rcv = rcv; ! pd_bind((t_pd *)x, x->x_rcv); } + } else if(!rcvable && x->x_rcv_able) { + pd_unbind((t_pd *)x, x->x_rcv); + x->x_rcv = rcv; } ! x->x_rcv_able = rcvable; ! iemgui_verify_snd_ne_rcv(x); ! if(glist_isvisible(x->x_glist)) x->x_draw(x,x->x_glist, 0); }
! void iemgui_label(t_iemgui *x, t_symbol *s) { t_symbol *lab = iemgui_raute2dollar(s); ! x->x_lab_unexpanded = lab; ! x->x_lab = lab = canvas_realizedollar(x->x_glist, lab); ! if(glist_isvisible(x->x_glist)) x->x_draw(x,x->x_glist, 0); }
! void iemgui_label_pos(t_iemgui *x, t_float ldx, t_float ldy) { ! x->x_ldx = (int)ldx; ! x->x_ldy = (int)ldy; ! if(glist_isvisible(x->x_glist)) x->x_draw(x,x->x_glist, 0); }
! void iemgui_label_font(t_iemgui *x, t_symbol *s, int ac, t_atom *av) { int f = MAX(4,(int)atom_getintarg(1, ac, av)); ! x->x_fontsize = f; ! x->x_font_style = atom_getintarg(0, ac, av); ! if(glist_isvisible(x->x_glist)) x->x_draw(x,x->x_glist, 0); }
! void iemgui_size(t_iemgui *x) { ! if(glist_isvisible(x->x_glist)) { ! x->x_draw(x,x->x_glist, 0); ! canvas_fixlinesfor(glist_getcanvas(x->x_glist), (t_text*)x); } }
! void iemgui_delta(t_iemgui *x, t_symbol *s, int ac, t_atom *av) { ! x->x_obj.te_xpix += (int)atom_getintarg(0, ac, av); ! x->x_obj.te_ypix += (int)atom_getintarg(1, ac, av); ! iemgui_size(x); }
! void iemgui_pos(t_iemgui *x, t_symbol *s, int ac, t_atom *av) { ! x->x_obj.te_xpix = (int)atom_getintarg(0, ac, av); ! x->x_obj.te_ypix = (int)atom_getintarg(1, ac, av); ! iemgui_size(x); }
*************** *** 260,271 **** {return i>=0 ? iemgui_color_hex[i%IEM_GUI_MAX_COLOR] : (~i)&0xffffff;}
! void iemgui_color(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) { int i=0; ! iemgui->x_bcol = iemgui_compatible_col(atom_getintarg(i++, ac, av)); ! if(ac > 2) iemgui->x_fcol = iemgui_compatible_col(atom_getintarg(i++, ac, av)); ! iemgui->x_lcol = iemgui_compatible_col(atom_getintarg(i++, ac, av)); ! if(glist_isvisible(iemgui->x_glist)) ! iemgui->x_draw(iemgui, iemgui->x_glist, 0); }
--- 224,234 ---- {return i>=0 ? iemgui_color_hex[i%IEM_GUI_MAX_COLOR] : (~i)&0xffffff;}
! void iemgui_color(t_iemgui *x, t_symbol *s, int ac, t_atom *av) { int i=0; ! x->x_bcol = iemgui_compatible_col(atom_getintarg(i++, ac, av)); ! if(ac > 2) x->x_fcol = iemgui_compatible_col(atom_getintarg(i++, ac, av)); ! x->x_lcol = iemgui_compatible_col(atom_getintarg(i++, ac, av)); ! if(glist_isvisible(x->x_glist)) x->x_draw(x,x->x_glist,0); }
*************** *** 275,300 **** x->x_obj.te_xpix += dx; x->x_obj.te_ypix += dy; ! x->x_draw((void *)z, glist, 0); canvas_fixlinesfor(glist_getcanvas(glist), (t_text *)z); }
void iemgui_select(t_gobj *z, t_glist *glist, int selected) ! { ! t_iemgui *x = (t_iemgui *)z; ! x->x_selected = selected; ! x->x_draw((void *)z, glist, IEM_GUI_DRAW_MODE_SELECT); ! }
void iemgui_delete(t_gobj *z, t_glist *glist) ! { ! canvas_deletelinesfor(glist, (t_text *)z); /*why?*/ ! }
void iemgui_vis(t_gobj *z, t_glist *glist, int vis) ! { ! ((t_iemgui *)z)->x_draw(z, glist, vis ? 0 : IEM_GUI_DRAW_MODE_ERASE); ! }
! void iemgui_save(t_iemgui *iemgui, t_symbol **srl, int *bflcol) { srl[0] = iemgui->x_snd; --- 238,255 ---- x->x_obj.te_xpix += dx; x->x_obj.te_ypix += dy; ! x->x_draw(z, glist, 0); canvas_fixlinesfor(glist_getcanvas(glist), (t_text *)z); }
void iemgui_select(t_gobj *z, t_glist *glist, int selected) ! {t_iemgui *x = (t_iemgui *)z; x->x_selected = selected; x->x_draw(z, glist, IEM_GUI_DRAW_MODE_SELECT);}
void iemgui_delete(t_gobj *z, t_glist *glist) ! {canvas_deletelinesfor(glist, (t_text *)z); /*why?*/}
void iemgui_vis(t_gobj *z, t_glist *glist, int vis) ! {((t_iemgui *)z)->x_draw(z, glist, vis ? 0 : IEM_GUI_DRAW_MODE_ERASE);}
! void iemgui_save(t_iemgui *iemgui, t_symbol **srl, int *col) { srl[0] = iemgui->x_snd; *************** *** 302,311 **** srl[2] = iemgui->x_lab; iemgui_all_sym2dollararg(iemgui, srl); ! iemgui_all_col2save(iemgui, bflcol); }
/* it used to be that [bng] et al would call iemgui_properties(&x->x_gui, srl); when opening a dialog. i don't exactly know what this code is for... */ ! void iemgui_properties(t_iemgui *iemgui, t_symbol **srl) { srl[0] = iemgui->x_snd; --- 257,270 ---- srl[2] = iemgui->x_lab; iemgui_all_sym2dollararg(iemgui, srl); ! if (!col) return; ! col[0] = convert_color2(iemgui->x_bcol); ! col[1] = convert_color2(iemgui->x_fcol); ! col[2] = convert_color2(iemgui->x_lcol); }
/* it used to be that [bng] et al would call iemgui_properties(&x->x_gui, srl); when opening a dialog. i don't exactly know what this code is for... */ ! /* ! static void iemgui_properties(t_iemgui *iemgui, t_symbol **srl) { srl[0] = iemgui->x_snd; *************** *** 317,320 **** --- 276,280 ---- srl[2] = iemgui_dollar2raute(srl[2]); } + */
/* *************** *** 501,505 **** class_addmethod(c, (t_method)iemgui_receive, gensym("receive"), A_DEFSYM, 0); class_addmethod(c, (t_method)iemgui_label, gensym("label"), A_DEFSYM, 0); ! 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); --- 461,465 ---- class_addmethod(c, (t_method)iemgui_receive, gensym("receive"), A_DEFSYM, 0); class_addmethod(c, (t_method)iemgui_label, gensym("label"), A_DEFSYM, 0); ! class_addmethod(c, (t_method)iemgui_label_pos, gensym("label_pos"), A_FLOAT, A_FLOAT, 0); class_addmethod(c, (t_method)iemgui_label_font, gensym("label_font"), A_GIMME, 0); class_setpropertiesfn(c, iemgui_propertiesfn);
Index: g_mycanvas.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_mycanvas.c,v retrieving revision 1.1.1.3.2.2.2.11 retrieving revision 1.1.1.3.2.2.2.12 diff -C2 -d -r1.1.1.3.2.2.2.11 -r1.1.1.3.2.2.2.12 *** g_mycanvas.c 3 May 2004 17:03:29 -0000 1.1.1.3.2.2.2.11 --- g_mycanvas.c 3 May 2004 21:18:38 -0000 1.1.1.3.2.2.2.12 *************** *** 43,55 **** { t_my_canvas *x = (t_my_canvas *)z; ! int bflcol[3]; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, bflcol); binbuf_addv(b, "ssiisiiisssiiiiiii", gensym("#X"),gensym("obj"), ! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix, ! gensym("cnv"), x->x_gui.x_w, x->x_vis_w, x->x_vis_h, ! 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[2], iem_symargstoint(&x->x_gui)); binbuf_addv(b, ";"); } --- 43,56 ---- { t_my_canvas *x = (t_my_canvas *)z; ! t_iemgui *y = (t_iemgui *)x; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, 0); binbuf_addv(b, "ssiisiiisssiiiiiii", gensym("#X"),gensym("obj"), ! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix, ! gensym("cnv"), x->x_gui.x_w, x->x_vis_w, x->x_vis_h, ! 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, ! convert_color2(y->x_bcol), convert_color2(y->x_lcol), ! iem_symargstoint(&x->x_gui)); binbuf_addv(b, ";"); } *************** *** 88,92 **** &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); --- 89,92 ----
Index: g_hslider.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v retrieving revision 1.1.1.3.2.2.2.21 retrieving revision 1.1.1.3.2.2.2.22 diff -C2 -d -r1.1.1.3.2.2.2.21 -r1.1.1.3.2.2.2.22 *** g_hslider.c 3 May 2004 17:03:28 -0000 1.1.1.3.2.2.2.21 --- g_hslider.c 3 May 2004 21:18:38 -0000 1.1.1.3.2.2.2.22 *************** *** 62,76 **** { 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, ";"); } --- 62,76 ---- { t_slider *x = (t_slider *)z; ! t_iemgui *y = (t_iemgui *)x; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, 0); binbuf_addv(b, "ssiisiiffiisssiiiiiiiii", gensym("#X"),gensym("obj"), ! (t_int)y->x_obj.te_xpix, (t_int)y->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, ! convert_color2(y->x_bcol), convert_color2(y->x_fcol), convert_color2(y->x_lcol), ! x->x_val, x->x_gui.x_steady); binbuf_addv(b, ";"); } *************** *** 221,225 **** 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); --- 221,224 ----
Index: g_all_guis.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_all_guis.h,v retrieving revision 1.1.1.4.2.2.2.20 retrieving revision 1.1.1.4.2.2.2.21 diff -C2 -d -r1.1.1.4.2.2.2.20 -r1.1.1.4.2.2.2.21 *** g_all_guis.h 3 May 2004 19:49:34 -0000 1.1.1.4.2.2.2.20 --- g_all_guis.h 3 May 2004 21:18:39 -0000 1.1.1.4.2.2.2.21 *************** *** 47,51 **** t_symbol *x_snd_unexpanded, *x_rcv_unexpanded, *x_lab_unexpanded; int x_binbufindex; /* where in binbuf to find snd/rcv/lab */ - int x_labelbindex; /* where in binbuf to find label */ } t_iemgui;
--- 47,50 ---- *************** *** 137,153 **** EXTERN void iemgui_verify_snd_ne_rcv(t_iemgui *iemgui); EXTERN t_symbol *iemgui_new_dogetname(t_iemgui *iemgui, int indx, t_atom *argv); ! EXTERN void iemgui_all_col2save(t_iemgui *iemgui, int *bflcol); ! //EXTERN void iemgui_all_colfromload(t_iemgui *iemgui, int *bflcol);
/* methods common to iemgui classes */ ! EXTERN void iemgui_send(t_iemgui *iemgui, t_symbol *s); ! EXTERN void iemgui_receive(t_iemgui *iemgui, t_symbol *s); ! EXTERN void iemgui_label(t_iemgui *iemgui, t_symbol *s); ! EXTERN void iemgui_label_pos(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av); ! EXTERN void iemgui_label_font(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av); ! EXTERN void iemgui_size(t_iemgui *iemgui); ! EXTERN void iemgui_delta(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av); ! EXTERN void iemgui_pos(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av); ! EXTERN void iemgui_color(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av);
/* adds the aforementioned methods to a iemgui class (pd has no inheritance) */ --- 136,151 ---- EXTERN void iemgui_verify_snd_ne_rcv(t_iemgui *iemgui); EXTERN t_symbol *iemgui_new_dogetname(t_iemgui *iemgui, int indx, t_atom *argv); ! //EXTERN void iemgui_all_col2save(t_iemgui *iemgui, int *bflcol);
/* methods common to iemgui classes */ ! EXTERN void iemgui_send (t_iemgui *x, t_symbol *s); ! EXTERN void iemgui_receive (t_iemgui *x, t_symbol *s); ! EXTERN void iemgui_label (t_iemgui *x, t_symbol *s); ! EXTERN void iemgui_label_pos (t_iemgui *x, t_float lx, t_float ly); ! EXTERN void iemgui_label_font(t_iemgui *x, t_symbol *s, int ac, t_atom *av); ! EXTERN void iemgui_delta (t_iemgui *x, t_symbol *s, int ac, t_atom *av); ! EXTERN void iemgui_pos (t_iemgui *x, t_symbol *s, int ac, t_atom *av); ! EXTERN void iemgui_color (t_iemgui *x, t_symbol *s, int ac, t_atom *av); ! EXTERN void iemgui_size (t_iemgui *x);
/* adds the aforementioned methods to a iemgui class (pd has no inheritance) */ *************** *** 160,164 **** EXTERN void iemgui_vis(t_gobj *z, t_glist *glist, int vis); EXTERN void iemgui_save(t_iemgui *iemgui, t_symbol **srl, int *bflcol); - EXTERN void iemgui_properties(t_iemgui *iemgui, t_symbol **srl); EXTERN int iemgui_dialog(t_iemgui *iemgui, t_symbol **srl, int argc, t_atom *argv);
--- 158,161 ---- *************** *** 177,178 **** --- 174,176 ---- EXTERN void iemgui_constrain(t_iemgui *x); EXTERN t_symbol *sym_empty; + EXTERN int convert_color2(int x);
Index: g_bang.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v retrieving revision 1.1.1.3.2.2.2.21 retrieving revision 1.1.1.3.2.2.2.22 diff -C2 -d -r1.1.1.3.2.2.2.21 -r1.1.1.3.2.2.2.22 *** g_bang.c 3 May 2004 17:03:28 -0000 1.1.1.3.2.2.2.21 --- g_bang.c 3 May 2004 21:18:38 -0000 1.1.1.3.2.2.2.22 *************** *** 44,56 **** { t_bng *x = (t_bng *)z; ! int bflcol[3]; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, bflcol); binbuf_addv(b, "ssiisiiiisssiiiiiii", gensym("#X"),gensym("obj"), ! (t_int)x->x_gui.x_obj.te_xpix, (t_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), 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]); binbuf_addv(b, ";"); } --- 44,56 ---- { t_bng *x = (t_bng *)z; ! t_iemgui *y = (t_iemgui *)x; t_symbol *srl[3]; ! iemgui_save(y,srl,0); binbuf_addv(b, "ssiisiiiisssiiiiiii", gensym("#X"),gensym("obj"), ! (t_int)((t_text *)x)->te_xpix, (t_int)((t_text *)x)->te_ypix, ! gensym("bng"), y->x_w, x->x_flashtime_hold, x->x_flashtime_break, iem_symargstoint(&x->x_gui), srl[0], srl[1], srl[2], ! y->x_ldx, y->x_ldy, y->x_font_style, y->x_fontsize, ! convert_color2(y->x_bcol), convert_color2(y->x_fcol), convert_color2(y->x_lcol)); binbuf_addv(b, ";"); } *************** *** 127,131 **** 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", --- 127,130 ----
Index: g_numbox.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v retrieving revision 1.1.1.4.2.2.2.16 retrieving revision 1.1.1.4.2.2.2.17 diff -C2 -d -r1.1.1.4.2.2.2.16 -r1.1.1.4.2.2.2.17 *** g_numbox.c 3 May 2004 17:03:29 -0000 1.1.1.4.2.2.2.16 --- g_numbox.c 3 May 2004 21:18:38 -0000 1.1.1.4.2.2.2.17 *************** *** 131,137 **** { t_my_numbox *x = (t_my_numbox *)z; ! int bflcol[3]; 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, --- 131,137 ---- { t_my_numbox *x = (t_my_numbox *)z; ! t_iemgui *y = (t_iemgui *)x; t_symbol *srl[3]; ! iemgui_save(&x->x_gui, srl, 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, *************** *** 140,144 **** 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, ";"); } --- 140,145 ---- 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, ! convert_color2(y->x_bcol), convert_color2(y->x_fcol), convert_color2(y->x_lcol), ! x->x_val, x->x_log_height); binbuf_addv(b, ";"); } *************** *** 324,328 **** { 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, --- 325,329 ---- { t_iemgui *y = (t_iemgui *)x; ! int isa=0, lilo=0, w; 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, *************** *** 332,336 **** --- 333,339 ---- y->x_lin0_log1 = lilo; if (!y->x_loadinit) x->x_val=0.0; + w=y->x_w; iemgui_constrain(y); + y->x_w=MAX(w,1); my_numbox_calc_fontwidth(x); my_numbox_check_minmax(x, x->x_min, x->x_max); *************** *** 352,356 **** 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); --- 355,358 ---- *************** *** 397,400 **** --- 399,403 ---- wb.w_deletefn = iemgui_delete; wb.w_visfn = iemgui_vis; + wb.w_clickfn = NULL; wb.w_clickfn = my_numbox_newclick; class_setwidget(c, &wb);