Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12287
Modified Files: Tag: impd_0_37 g_hslider.c g_vslider.c Log Message: merging hslider/vslider code and deleting 420 lines of code
Index: g_hslider.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v retrieving revision 1.1.1.3.2.2.2.3 retrieving revision 1.1.1.3.2.2.2.4 diff -C2 -d -r1.1.1.3.2.2.2.3 -r1.1.1.3.2.2.2.4 *** g_hslider.c 7 Mar 2004 19:38:13 -0000 1.1.1.3.2.2.2.3 --- g_hslider.c 8 Mar 2004 00:44:38 -0000 1.1.1.3.2.2.2.4 *************** *** 25,36 **** t_widgetbehavior hslider_widgetbehavior; static t_class *hslider_class;
/* widget helper functions */
static void hslider_draw_update(t_hslider *x, t_glist *glist) { t_canvas *canvas=glist_getcanvas(glist); if (glist_isvisible(glist)) ! {sys_vgui("slider_set .x%x.c %x %d 0 #%6.6x\n", canvas, x, x->x_val, x->x_gui.x_fcol);} }
--- 25,45 ---- t_widgetbehavior hslider_widgetbehavior; 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_update(t_hslider *x, t_glist *glist) { t_canvas *canvas=glist_getcanvas(glist); if (glist_isvisible(glist)) ! {sys_vgui("slider_set .x%x.c %x %d %d #%6.6x\n", canvas, x, x->x_val, ! isvert(x),x->x_gui.x_fcol);} }
*************** *** 40,47 **** int ypos=text_ypix(&x->x_gui.x_obj, glist); t_canvas *canvas=glist_getcanvas(glist); ! sys_vgui("slider_draw .x%x.c %x %d %d %d %d %d %d 0 #%6.6x\n", canvas, x, xpos, ypos, xpos+x->x_gui.x_w, ypos+x->x_gui.x_h, ! !x->x_gui.x_fsf.x_rcv_able, !x->x_gui.x_fsf.x_snd_able,x->x_gui.x_bcol); ! sys_vgui("slider_set .x%x.c %x %d 0 #%6.6x\n", canvas, x, x->x_val, x->x_gui.x_fcol); sys_vgui(".x%x.c create text %d %d -text {%s} -anchor w \ -font {%s %d bold} -fill #%6.6x -tags %xLABEL\n", --- 49,56 ---- int ypos=text_ypix(&x->x_gui.x_obj, glist); t_canvas *canvas=glist_getcanvas(glist); ! sys_vgui("slider_draw .x%x.c %x %d %d %d %d %d %d %d #%6.6x\n", canvas, x, xpos, ypos, xpos+x->x_gui.x_w, ypos+x->x_gui.x_h, ! !x->x_gui.x_fsf.x_rcv_able, !x->x_gui.x_fsf.x_snd_able,isvert(x),x->x_gui.x_bcol); ! sys_vgui("slider_set .x%x.c %x %d %d #%6.6x\n", canvas, x, x->x_val, isvert(x),x->x_gui.x_fcol); sys_vgui(".x%x.c create text %d %d -text {%s} -anchor w \ -font {%s %d bold} -fill #%6.6x -tags %xLABEL\n", *************** *** 56,63 **** int ypos=text_ypix(&x->x_gui.x_obj, glist); t_canvas *canvas=glist_getcanvas(glist); ! sys_vgui("slider_draw .x%x.c %x %d %d %d %d %d %d 0 #%6.6x\n", canvas, x, xpos, ypos, xpos+x->x_gui.x_w, ypos+x->x_gui.x_h, ! !x->x_gui.x_fsf.x_rcv_able, !x->x_gui.x_fsf.x_snd_able,x->x_gui.x_bcol); ! sys_vgui("slider_set .x%x.c %x %d 0 #%6.6x\n", canvas, x, x->x_val, x->x_gui.x_fcol); sys_vgui(".x%x.c coords %xLABEL %d %d\n", canvas, x, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy); --- 65,72 ---- int ypos=text_ypix(&x->x_gui.x_obj, glist); t_canvas *canvas=glist_getcanvas(glist); ! sys_vgui("slider_draw .x%x.c %x %d %d %d %d %d %d %d #%6.6x\n", canvas, x, xpos, ypos, xpos+x->x_gui.x_w, ypos+x->x_gui.x_h, ! !x->x_gui.x_fsf.x_rcv_able, !x->x_gui.x_fsf.x_snd_able,isvert(x),x->x_gui.x_bcol); ! sys_vgui("slider_set .x%x.c %x %d %d #%6.6x\n", canvas, x, x->x_val,isvert(x), x->x_gui.x_fcol); sys_vgui(".x%x.c coords %xLABEL %d %d\n", canvas, x, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy); *************** *** 80,88 **** x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:""); ! sys_vgui("slider_set .x%x.c %x %d 0 #%6.6x\n", canvas, x, x->x_val, x->x_gui.x_fcol); ! sys_vgui("slider_select .x%x.c %xBASE %d\n", canvas, x, x->x_gui.x_fsf.x_selected); }
! static void hslider_draw_select(t_hslider* x,t_glist* glist) { t_canvas *canvas=glist_getcanvas(glist); --- 89,97 ---- x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:""); ! sys_vgui("slider_set .x%x.c %x %d %d #%6.6x\n", canvas, x, x->x_val, isvert(x), x->x_gui.x_fcol); ! sys_vgui("slider_select .x%x.c %x %d\n", canvas, x, x->x_gui.x_fsf.x_selected); }
! static void hslider_draw_select(t_hslider *x, t_glist *glist) { t_canvas *canvas=glist_getcanvas(glist); *************** *** 92,96 **** }
! void hslider_draw(t_hslider *x, t_glist *glist, int mode) { if (mode == IEM_GUI_DRAW_MODE_UPDATE) hslider_draw_update(x, glist); --- 101,105 ---- }
! static void hslider_draw(t_hslider *x, t_glist *glist, int mode) { if (mode == IEM_GUI_DRAW_MODE_UPDATE) hslider_draw_update(x, glist); *************** *** 110,117 **** t_hslider* x = (t_hslider*)z;
! *xp1 = text_xpix(&x->x_gui.x_obj, glist) - 3; ! *yp1 = text_ypix(&x->x_gui.x_obj, glist); ! *xp2 = *xp1 + x->x_gui.x_w + 5; ! *yp2 = *yp1 + x->x_gui.x_h; }
--- 119,126 ---- t_hslider* x = (t_hslider*)z;
! *xp1 = text_xpix(&x->x_gui.x_obj, glist) - (isvert(x)?0:3); ! *yp1 = text_ypix(&x->x_gui.x_obj, glist) - (isvert(x)?2:0); ! *xp2 = *xp1 + x->x_gui.x_w + (isvert(x)?0:5); ! *yp2 = *yp1 + x->x_gui.x_h + (isvert(x)?5:0); }
*************** *** 125,129 **** 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, ! 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.x_isa), --- 134,138 ---- 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.x_isa), *************** *** 136,143 **** }
! void hslider_check_width(t_hslider *x, int w) { ! if(w < IEM_SL_MINSIZE) ! w = IEM_SL_MINSIZE; x->x_gui.x_w = w; x->x_center = (x->x_gui.x_w-1)*50; --- 145,165 ---- }
! static void hslider_check_width(t_hslider *x, int w) { ! if (isvert(x)) { ! if(w < IEM_SL_MINSIZE) w = IEM_SL_MINSIZE; ! x->x_gui.x_h = w; ! ! if(x->x_val > (x->x_gui.x_h*100 - 100)) ! { ! x->x_pos = x->x_gui.x_h*100 - 100; ! x->x_val = x->x_pos; ! } ! if(x->x_lin0_log1) ! x->x_k = log(x->x_max/x->x_min)/(double)(x->x_gui.x_h - 1); ! else ! x->x_k = (x->x_max - x->x_min)/(double)(x->x_gui.x_h - 1); ! } else { ! if(w < IEM_SL_MINSIZE) w = IEM_SL_MINSIZE; x->x_gui.x_w = w; x->x_center = (x->x_gui.x_w-1)*50; *************** *** 151,157 **** else x->x_k = (x->x_max - x->x_min)/(double)(x->x_gui.x_w - 1); ! }
! void hslider_check_minmax(t_hslider *x, double min, double max) { if(x->x_lin0_log1) --- 173,179 ---- else x->x_k = (x->x_max - x->x_min)/(double)(x->x_gui.x_w - 1); ! }}
! static void hslider_check_minmax(t_hslider *x, double min, double max) { if(x->x_lin0_log1) *************** *** 170,173 **** --- 192,201 ---- else x->x_gui.x_isa.x_reverse = 0; + if (isvert(x)) { + if(x->x_lin0_log1) + x->x_k = log(x->x_max/x->x_min)/(double)(x->x_gui.x_h - 1); + else + x->x_k = (x->x_max - x->x_min)/(double)(x->x_gui.x_h - 1); + } else { if(x->x_lin0_log1) x->x_k = log(x->x_max/x->x_min)/(double)(x->x_gui.x_w - 1); *************** *** 175,178 **** --- 203,207 ---- x->x_k = (x->x_max - x->x_min)/(double)(x->x_gui.x_w - 1); } + }
static void hslider_properties(t_gobj *z, t_glist *owner) *************** *** 257,263 **** x->x_steady = 0; sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); ! 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, IEM_GUI_DRAW_MODE_CONFIG); (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_IO + sr_flags); --- 286,297 ---- x->x_steady = 0; sr_flags = 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, IEM_GUI_DRAW_MODE_CONFIG); (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_IO + sr_flags); *************** *** 269,273 **** { int old = x->x_val; ! if(x->x_gui.x_fsf.x_finemoved) x->x_pos += (int)dx; --- 303,319 ---- { int old = x->x_val; ! if (isvert(x)) { ! if(x->x_gui.x_fsf.x_finemoved) ! x->x_pos -= (int)dy; ! else ! x->x_pos -= 100*(int)dy; ! x->x_val = x->x_pos; ! if(x->x_val > (100*x->x_gui.x_h - 100)) ! { ! x->x_val = 100*x->x_gui.x_h - 100; ! x->x_pos += 50; ! x->x_pos -= x->x_pos%100; ! } ! }else{ if(x->x_gui.x_fsf.x_finemoved) x->x_pos += (int)dx; *************** *** 281,284 **** --- 327,331 ---- x->x_pos -= x->x_pos%100; } + } if(x->x_val < 0) { *************** *** 297,304 **** t_floatarg shift, t_floatarg ctrl, t_floatarg alt) { if(!x->x_steady) x->x_val = (int)(100.0 * (xpos - text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist))); ! if(x->x_val > (100*x->x_gui.x_w - 100)) x->x_val = 100*x->x_gui.x_w - 100; if(x->x_val < 0) x->x_val = 0; --- 344,358 ---- t_floatarg shift, t_floatarg ctrl, t_floatarg alt) { + if (isvert(x)) { + if(!x->x_steady) + x->x_val = (int)(100.0 * (x->x_gui.x_h + text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist) - ypos)); + if(x->x_val > (100*x->x_gui.x_h - 100)) + x->x_val = 100*x->x_gui.x_h - 100; + }else{ if(!x->x_steady) x->x_val = (int)(100.0 * (xpos - text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist))); ! if(x->x_val > (100*x->x_gui.x_w - 100)) x->x_val = 100*x->x_gui.x_w - 100; + } if(x->x_val < 0) x->x_val = 0; *************** *** 319,326 **** hslider_click( x, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); ! if(shift) ! x->x_gui.x_fsf.x_finemoved = 1; ! else ! x->x_gui.x_fsf.x_finemoved = 0; } return (1); --- 373,377 ---- hslider_click( x, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); ! x->x_gui.x_fsf.x_finemoved = !!shift; } return (1); *************** *** 329,337 **** static void hslider_size(t_hslider *x, t_symbol *s, int ac, t_atom *av) { 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)); iemgui_size((void *)x, &x->x_gui); ! }
static void hslider_delta(t_hslider *x, t_symbol *s, int ac, t_atom *av) --- 380,394 ---- 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)); + iemgui_size((void *)x, &x->x_gui); + }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)); iemgui_size((void *)x, &x->x_gui); ! }}
static void hslider_delta(t_hslider *x, t_symbol *s, int ac, t_atom *av) *************** *** 406,409 **** --- 463,475 ---- }
+ /* VSlider's + static void hslider_float(t_hslider *x, t_floatarg f) + { + hslider_set(x, f); + if(x->x_gui.x_fsf.x_put_in2out) + hslider_bang(x); + } + */ + static void hslider_loadbang(t_hslider *x) { *************** *** 417,421 **** static void *hslider_new(t_symbol *s, int argc, t_atom *argv) { - t_hslider *x = (t_hslider *)pd_new(hslider_class); int bflcol[]={-262144, -1, -1}; int w=IEM_SL_DEFAULTSIZE, h=IEM_GUI_DEFAULTSIZE; --- 483,486 ---- *************** *** 423,427 **** double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1); char str[144]; ! iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); --- 488,498 ---- double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1); char str[144]; ! t_hslider *x; ! if (s==gensym("hsl") || s==gensym("hslider")) { ! x = (t_hslider *)pd_new(hslider_class); ! } else if (s==gensym("vsl") || s==gensym("vslider")) { ! x = (t_hslider *)pd_new(vslider_class); ! } else abort(); ! if (isvert(x)) w=IEM_GUI_DEFAULTSIZE, h=IEM_SL_DEFAULTSIZE; iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); *************** *** 462,468 **** fs = 4; x->x_gui.x_fontsize = fs; ! 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); x->x_thick = 0; --- 533,545 ---- fs = 4; x->x_gui.x_fontsize = fs; ! if (isvert(x)) { ! x->x_gui.x_w = iemgui_clip_size(w); ! hslider_check_width(x, h); ! hslider_check_minmax(x, min, max); ! }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); x->x_thick = 0; *************** *** 479,512 **** }
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); #ifndef GGEE_HSLIDER_COMPATIBLE class_addcreator((t_newmethod)hslider_new, gensym("hslider"), A_GIMME, 0); #endif ! class_addbang(hslider_class,hslider_bang); ! class_addfloat(hslider_class,hslider_float); ! class_addmethod(hslider_class, (t_method)hslider_click, gensym("click"), ! A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); ! class_addmethod(hslider_class, (t_method)hslider_motion, gensym("motion"), ! A_FLOAT, A_FLOAT, 0); ! class_addmethod(hslider_class, (t_method)hslider_dialog, gensym("dialog"), A_GIMME, 0); ! class_addmethod(hslider_class, (t_method)hslider_loadbang, gensym("loadbang"), 0); ! class_addmethod(hslider_class, (t_method)hslider_set, gensym("set"), A_FLOAT, 0); ! class_addmethod(hslider_class, (t_method)hslider_size, gensym("size"), A_GIMME, 0); ! class_addmethod(hslider_class, (t_method)hslider_delta, gensym("delta"), A_GIMME, 0); ! class_addmethod(hslider_class, (t_method)hslider_pos, gensym("pos"), A_GIMME, 0); ! class_addmethod(hslider_class, (t_method)hslider_range, gensym("range"), A_GIMME, 0); ! class_addmethod(hslider_class, (t_method)hslider_color, gensym("color"), A_GIMME, 0); ! class_addmethod(hslider_class, (t_method)hslider_send, gensym("send"), A_DEFSYM, 0); ! class_addmethod(hslider_class, (t_method)hslider_receive, gensym("receive"), A_DEFSYM, 0); ! class_addmethod(hslider_class, (t_method)hslider_label, gensym("label"), A_DEFSYM, 0); ! class_addmethod(hslider_class, (t_method)hslider_label_pos, gensym("label_pos"), A_GIMME, 0); ! class_addmethod(hslider_class, (t_method)hslider_label_font, gensym("label_font"), A_GIMME, 0); ! class_addmethod(hslider_class, (t_method)hslider_log, gensym("log"), 0); ! class_addmethod(hslider_class, (t_method)hslider_lin, gensym("lin"), 0); ! class_addmethod(hslider_class, (t_method)hslider_init, gensym("init"), A_FLOAT, 0); ! class_addmethod(hslider_class, (t_method)hslider_steady, gensym("steady"), A_FLOAT, 0); hslider_widgetbehavior.w_getrectfn = hslider_getrect; hslider_widgetbehavior.w_displacefn = iemgui_displace; --- 556,596 ---- }
+ static void hslider_methods(t_class *c) { + class_addbang(c,hslider_bang); + class_addfloat(c,hslider_float); + class_addmethod(c, (t_method)hslider_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); + 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); + class_addmethod(c, (t_method)hslider_delta, gensym("delta"), A_GIMME, 0); + class_addmethod(c, (t_method)hslider_pos, gensym("pos"), A_GIMME, 0); + class_addmethod(c, (t_method)hslider_range, gensym("range"), A_GIMME, 0); + class_addmethod(c, (t_method)hslider_color, gensym("color"), A_GIMME, 0); + class_addmethod(c, (t_method)hslider_send, gensym("send"), A_DEFSYM, 0); + class_addmethod(c, (t_method)hslider_receive, gensym("receive"), A_DEFSYM, 0); + class_addmethod(c, (t_method)hslider_label, gensym("label"), A_DEFSYM, 0); + class_addmethod(c, (t_method)hslider_label_pos, gensym("label_pos"), A_GIMME, 0); + class_addmethod(c, (t_method)hslider_label_font, gensym("label_font"), A_GIMME, 0); + class_addmethod(c, (t_method)hslider_log, gensym("log"), 0); + class_addmethod(c, (t_method)hslider_lin, gensym("lin"), 0); + class_addmethod(c, (t_method)hslider_init, gensym("init"), A_FLOAT, 0); + class_addmethod(c, (t_method)hslider_steady, gensym("steady"), A_FLOAT, 0); + } + 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); hslider_widgetbehavior.w_getrectfn = hslider_getrect; hslider_widgetbehavior.w_displacefn = iemgui_displace; *************** *** 516,522 **** --- 600,613 ---- hslider_widgetbehavior.w_visfn = iemgui_vis; hslider_widgetbehavior.w_clickfn = hslider_newclick; + class_setwidget(hslider_class, &hslider_widgetbehavior); + class_setwidget(vslider_class, &hslider_widgetbehavior); 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) {}
Index: g_vslider.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_vslider.c,v retrieving revision 1.1.1.3.2.2.2.3 retrieving revision 1.1.1.3.2.2.2.4 diff -C2 -d -r1.1.1.3.2.2.2.3 -r1.1.1.3.2.2.2.4 *** g_vslider.c 7 Mar 2004 19:38:13 -0000 1.1.1.3.2.2.2.3 --- g_vslider.c 8 Mar 2004 00:44:38 -0000 1.1.1.3.2.2.2.4 *************** *** 1,520 **** - /* Copyright (c) 1997-1999 Miller Puckette. - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - - /* g_7_guis.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */ - /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ - - - #include <stdlib.h> - #include <string.h> - #include <stdio.h> - #include <ctype.h> - #include "m_pd.h" - #include "g_canvas.h" - #include "t_tk.h" - #include "g_all_guis.h" - #include <math.h> - - #ifdef MSW - #include <io.h> - #else - #include <unistd.h> - #endif - - t_widgetbehavior vslider_widgetbehavior; - static t_class *vslider_class; - - /* widget helper functions */ - - static void vslider_draw_update(t_vslider *x, t_glist *glist) - { - t_canvas *canvas=glist_getcanvas(glist); - if (glist_isvisible(glist)) - {sys_vgui("slider_set .x%x.c %x %d 1 #%6.6x\n", canvas, x, x->x_val, x->x_gui.x_fcol);} - } - - static void vslider_draw_new(t_vslider *x, t_glist *glist) - { - int xpos=text_xpix(&x->x_gui.x_obj, glist); - int ypos=text_ypix(&x->x_gui.x_obj, glist); - t_canvas *canvas=glist_getcanvas(glist); - sys_vgui("slider_draw .x%x.c %x %d %d %d %d %d %d 1 #%6.6x\n", - canvas, x, xpos, ypos, xpos+x->x_gui.x_w, ypos+x->x_gui.x_h, - !x->x_gui.x_fsf.x_rcv_able, !x->x_gui.x_fsf.x_snd_able,x->x_gui.x_bcol); - sys_vgui("slider_set .x%x.c %x %d 1 #%6.6x\n", canvas, x, x->x_val, x->x_gui.x_fcol); - sys_vgui(".x%x.c create text %d %d -text {%s} -anchor w \ - -font {%s %d bold} -fill #%6.6x -tags %xLABEL\n", - canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy, - strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", - x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x); - } - - static void vslider_draw_move(t_vslider *x, t_glist *glist) - { - int xpos=text_xpix(&x->x_gui.x_obj, glist); - int ypos=text_ypix(&x->x_gui.x_obj, glist); - t_canvas *canvas=glist_getcanvas(glist); - sys_vgui("slider_draw .x%x.c %x %d %d %d %d %d %d 1 #%6.6x\n", - canvas, x, xpos, ypos, xpos+x->x_gui.x_w, ypos+x->x_gui.x_h, - !x->x_gui.x_fsf.x_rcv_able, !x->x_gui.x_fsf.x_snd_able,x->x_gui.x_bcol); - sys_vgui("slider_set .x%x.c %x %d 1 #%6.6x\n", canvas, x, x->x_val, x->x_gui.x_fcol); - sys_vgui(".x%x.c coords %xLABEL %d %d\n", - canvas, x, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy); - } - - static void vslider_draw_erase(t_vslider* x,t_glist* glist) - { - t_canvas *canvas=glist_getcanvas(glist); - sys_vgui("slider_erase .x%x.c %x\n", canvas, x); - sys_vgui(".x%x.c delete %xLABEL\n", canvas, x); - } - - static void vslider_draw_config(t_vslider* x,t_glist* glist) - { - t_canvas *canvas=glist_getcanvas(glist); - int xpos=text_xpix(&x->x_gui.x_obj, glist); - int ypos=text_ypix(&x->x_gui.x_obj, glist); - sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", - canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, - x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol, - strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:""); - sys_vgui("slider_set .x%x.c %x %d 1 #%6.6x\n", canvas, x, x->x_val, x->x_gui.x_fcol); - sys_vgui("slider_select .x%x.c %xBASE %d\n", canvas, x, x->x_gui.x_fsf.x_selected); - } - - static void vslider_draw_select(t_vslider *x, t_glist *glist) - { - t_canvas *canvas=glist_getcanvas(glist); - sys_vgui("slider_select .x%x.c %x %d\n", canvas, x, x->x_gui.x_fsf.x_selected); - sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, - x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol); - } - - void vslider_draw(t_vslider *x, t_glist *glist, int mode) - { - if (mode == IEM_GUI_DRAW_MODE_UPDATE) vslider_draw_update(x, glist); - else if(mode == IEM_GUI_DRAW_MODE_MOVE) vslider_draw_move(x, glist); - else if(mode == IEM_GUI_DRAW_MODE_NEW) vslider_draw_new(x, glist); - else if(mode == IEM_GUI_DRAW_MODE_SELECT) vslider_draw_select(x, glist); - else if(mode == IEM_GUI_DRAW_MODE_ERASE) vslider_draw_erase(x, glist); - else if(mode == IEM_GUI_DRAW_MODE_CONFIG) vslider_draw_config(x, glist); - else if(mode >= IEM_GUI_DRAW_MODE_IO) vslider_draw_move(x, glist); - } - - /* ------------------------ vsl widgetbehaviour----------------------------- */ - - static void vslider_getrect(t_gobj *z, t_glist *glist, - int *xp1, int *yp1, int *xp2, int *yp2) - { - t_vslider* x = (t_vslider*)z; - - *xp1 = text_xpix(&x->x_gui.x_obj, glist); - *yp1 = text_ypix(&x->x_gui.x_obj, glist) - 2; - *xp2 = *xp1 + x->x_gui.x_w; - *yp2 = *yp1 + x->x_gui.x_h + 5; - } - - static void vslider_save(t_gobj *z, t_binbuf *b) - { - t_vslider *x = (t_vslider *)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, - gensym("vsl"), 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.x_isa), - 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, - bflcol[0], bflcol[1], bflcol[2], - x->x_val, x->x_steady); - binbuf_addv(b, ";"); - } - - void vslider_check_height(t_vslider *x, int h) - { - if(h < IEM_SL_MINSIZE) - h = IEM_SL_MINSIZE; - x->x_gui.x_h = h; - - if(x->x_val > (x->x_gui.x_h*100 - 100)) - { - x->x_pos = x->x_gui.x_h*100 - 100; - x->x_val = x->x_pos; - } - if(x->x_lin0_log1) - x->x_k = log(x->x_max/x->x_min)/(double)(x->x_gui.x_h - 1); - else - x->x_k = (x->x_max - x->x_min)/(double)(x->x_gui.x_h - 1); - } - - void vslider_check_minmax(t_vslider *x, double min, double max) - { - 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; - } else { - if(min > 0.0) max = 0.01*min; - } - } - x->x_min = min; - x->x_max = max; - if(x->x_min > x->x_max) /* bugfix */ - x->x_gui.x_isa.x_reverse = 1; - else - x->x_gui.x_isa.x_reverse = 0; - if(x->x_lin0_log1) - x->x_k = log(x->x_max/x->x_min)/(double)(x->x_gui.x_h - 1); - else - x->x_k = (x->x_max - x->x_min)/(double)(x->x_gui.x_h - 1); - } - - static void vslider_properties(t_gobj *z, t_glist *owner) - { - t_vslider *x = (t_vslider *)z; - char buf[800]; - t_symbol *srl[3]; - - iemgui_properties(&x->x_gui, srl); - sprintf(buf, "pdtk_iemgui_dialog %%s VSLIDER \ - --------dimensions(pix)(pix):-------- %d %d width: %d %d height: \ - -----------output-range:----------- %g bottom: %g top: %d \ - %d lin log %d %d empty %d \ - %s %s \ - %s %d %d \ - %d %d \ - %d %d %d\n", - x->x_gui.x_w, IEM_GUI_MINSIZE, x->x_gui.x_h, IEM_SL_MINSIZE, - x->x_min, x->x_max, 0,/*no_schedule*/ - x->x_lin0_log1, x->x_gui.x_isa.x_loadinit, x->x_steady, -1,/*no multi, but iem-characteristic*/ - 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, - 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); - } - - static void vslider_bang(t_vslider *x) - { - double out; - - if(x->x_lin0_log1) - out = x->x_min*exp(x->x_k*(double)(x->x_val)*0.01); - else - out = (double)(x->x_val)*0.01*x->x_k + x->x_min; - if((out < 1.0e-10)&&(out > -1.0e-10)) - out = 0.0; - - outlet_float(x->x_gui.x_obj.ob_outlet, out); - if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing) - pd_float(x->x_gui.x_snd->s_thing, out); - } - - static void vslider_dialog(t_vslider *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); - int sr_flags; - - if(lilo != 0) lilo = 1; - x->x_lin0_log1 = lilo; - if(steady) - x->x_steady = 1; - else - x->x_steady = 0; - sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); - x->x_gui.x_w = iemgui_clip_size(w); - vslider_check_height(x, h); - vslider_check_minmax(x, min, max); - (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_CONFIG); - (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_IO + sr_flags); - (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_MOVE); - canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x); - } - - static void vslider_motion(t_vslider *x, t_floatarg dx, t_floatarg dy) - { - int old = x->x_val; - - if(x->x_gui.x_fsf.x_finemoved) - x->x_pos -= (int)dy; - else - x->x_pos -= 100*(int)dy; - x->x_val = x->x_pos; - if(x->x_val > (100*x->x_gui.x_h - 100)) - { - x->x_val = 100*x->x_gui.x_h - 100; - x->x_pos += 50; - x->x_pos -= x->x_pos%100; - } - 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, IEM_GUI_DRAW_MODE_UPDATE); - vslider_bang(x); - } - } - - static void vslider_click(t_vslider *x, t_floatarg xpos, t_floatarg ypos, - t_floatarg shift, t_floatarg ctrl, t_floatarg alt) - { - if(!x->x_steady) - x->x_val = (int)(100.0 * (x->x_gui.x_h + text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist) - ypos)); - if(x->x_val > (100*x->x_gui.x_h - 100)) - x->x_val = 100*x->x_gui.x_h - 100; - if(x->x_val < 0) - x->x_val = 0; - x->x_pos = x->x_val; - (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); - vslider_bang(x); - glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, - (t_glistmotionfn)vslider_motion, 0, xpos, ypos); - } - - static int vslider_newclick(t_gobj *z, struct _glist *glist, - int xpix, int ypix, int shift, int alt, int dbl, int doit) - { - t_vslider* x = (t_vslider *)z; - - if(doit) - { - vslider_click( x, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, - 0, (t_floatarg)alt); - if(shift) - x->x_gui.x_fsf.x_finemoved = 1; - else - x->x_gui.x_fsf.x_finemoved = 0; - } - return (1); - } - - static void vslider_set(t_vslider *x, t_floatarg f) - { - double g; - - if(x->x_gui.x_isa.x_reverse) /* bugfix */ - { - if(f > x->x_min) - f = x->x_min; - if(f < x->x_max) - f = x->x_max; - } - else - { - if(f > x->x_max) - f = x->x_max; - if(f < x->x_min) - f = x->x_min; - } - if(x->x_lin0_log1) - g = log(f/x->x_min)/x->x_k; - else - g = (f - x->x_min) / x->x_k; - x->x_val = (int)(100.0*g + 0.49999); - x->x_pos = x->x_val; - (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); - } - - static void vslider_float(t_vslider *x, t_floatarg f) - { - vslider_set(x, f); - if(x->x_gui.x_fsf.x_put_in2out) - vslider_bang(x); - } - - static void vslider_size(t_vslider *x, t_symbol *s, int ac, t_atom *av) - { - x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); - if(ac > 1) - vslider_check_height(x, (int)atom_getintarg(1, ac, av)); - iemgui_size((void *)x, &x->x_gui); - } - - static void vslider_delta(t_vslider *x, t_symbol *s, int ac, t_atom *av) - {iemgui_delta((void *)x, &x->x_gui, s, ac, av);} - - static void vslider_pos(t_vslider *x, t_symbol *s, int ac, t_atom *av) - {iemgui_pos((void *)x, &x->x_gui, s, ac, av);} - - static void vslider_range(t_vslider *x, t_symbol *s, int ac, t_atom *av) - { - vslider_check_minmax(x, (double)atom_getfloatarg(0, ac, av), - (double)atom_getfloatarg(1, ac, av)); - } - - static void vslider_color(t_vslider *x, t_symbol *s, int ac, t_atom *av) - {iemgui_color((void *)x, &x->x_gui, s, ac, av);} - - static void vslider_send(t_vslider *x, t_symbol *s) - {iemgui_send(x, &x->x_gui, s);} - - static void vslider_receive(t_vslider *x, t_symbol *s) - {iemgui_receive(x, &x->x_gui, s);} - - static void vslider_label(t_vslider *x, t_symbol *s) - {iemgui_label((void *)x, &x->x_gui, s);} - - static void vslider_label_pos(t_vslider *x, t_symbol *s, int ac, t_atom *av) - {iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);} - - static void vslider_label_font(t_vslider *x, t_symbol *s, int ac, t_atom *av) - {iemgui_label_font((void *)x, &x->x_gui, s, ac, av);} - - static void vslider_log(t_vslider *x) - { - x->x_lin0_log1 = 1; - vslider_check_minmax(x, x->x_min, x->x_max); - } - - static void vslider_lin(t_vslider *x) - { - x->x_lin0_log1 = 0; - x->x_k = (x->x_max - x->x_min)/(double)(x->x_gui.x_h - 1); - } - - static void vslider_init(t_vslider *x, t_floatarg f) - { - x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1; - } - - static void vslider_steady(t_vslider *x, t_floatarg f) - { - x->x_steady = (f==0.0)?0:1; - } - - static void vslider_loadbang(t_vslider *x) - { - if(!sys_noloadbang && x->x_gui.x_isa.x_loadinit) - { - (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); - vslider_bang(x); - } - } - - - - - - - - - static void *vslider_new(t_symbol *s, int argc, t_atom *argv) - { - t_vslider *x = (t_vslider *)pd_new(vslider_class); - int bflcol[]={-262144, -1, -1}; - int w=IEM_GUI_DEFAULTSIZE, h=IEM_SL_DEFAULTSIZE; - int lilo=0, ldx=0, ldy=-8, f=0, v=0, steady=1, fs=8; - double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1); - char str[144]; - - iem_inttosymargs(&x->x_gui.x_isa, 0); - iem_inttofstyle(&x->x_gui.x_fsf, 0); - - if(pd_scanargs(argc,argv,"iiffiF???iiFiiiii?;?", - &w,&h,&min,&max,&lilo,&ldx,&ldy,&fs,&bflcol[0],&bflcol[1],&bflcol[2],&v)) - { - iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(5, argc, argv)); - iemgui_new_getnames(&x->x_gui, 6, argv); - iem_inttofstyle(&x->x_gui.x_fsf, atom_getintarg(11, argc, argv)); - } - else iemgui_new_getnames(&x->x_gui, 6, 0); - if((argc == 18)&&IS_A_FLOAT(argv,17)) - steady = (int)atom_getintarg(17, argc, argv); - x->x_gui.x_draw = (t_iemfunptr)vslider_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(x->x_gui.x_isa.x_loadinit) - x->x_val = v; - else - x->x_val = 0; - x->x_pos = x->x_val; - if(lilo != 0) lilo = 1; - x->x_lin0_log1 = lilo; - if(steady != 0) steady = 1; - x->x_steady = steady; - 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, "courier"); } - if(x->x_gui.x_fsf.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; - if(fs < 4) - fs = 4; - x->x_gui.x_fontsize = fs; - x->x_gui.x_w = iemgui_clip_size(w); - vslider_check_height(x, h); - vslider_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 vslider_free(t_vslider *x) - { - if(x->x_gui.x_fsf.x_rcv_able) - pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); - gfxstub_deleteforkey(x); - } - - void g_vslider_setup(void) - { - vslider_class = class_new(gensym("vsl"), (t_newmethod)vslider_new, - (t_method)vslider_free, sizeof(t_vslider), 0, A_GIMME, 0); - class_addcreator((t_newmethod)vslider_new, gensym("vslider"), A_GIMME, 0); - class_addbang(vslider_class,vslider_bang); - class_addfloat(vslider_class,vslider_float); - class_addmethod(vslider_class, (t_method)vslider_click, gensym("click"), - A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); - class_addmethod(vslider_class, (t_method)vslider_motion, gensym("motion"), - A_FLOAT, A_FLOAT, 0); - class_addmethod(vslider_class, (t_method)vslider_dialog, gensym("dialog"), - A_GIMME, 0); - class_addmethod(vslider_class, (t_method)vslider_loadbang, gensym("loadbang"), 0); - class_addmethod(vslider_class, (t_method)vslider_set, gensym("set"), A_FLOAT, 0); - class_addmethod(vslider_class, (t_method)vslider_size, gensym("size"), A_GIMME, 0); - class_addmethod(vslider_class, (t_method)vslider_delta, gensym("delta"), A_GIMME, 0); - class_addmethod(vslider_class, (t_method)vslider_pos, gensym("pos"), A_GIMME, 0); - class_addmethod(vslider_class, (t_method)vslider_range, gensym("range"), A_GIMME, 0); - class_addmethod(vslider_class, (t_method)vslider_color, gensym("color"), A_GIMME, 0); - class_addmethod(vslider_class, (t_method)vslider_send, gensym("send"), A_DEFSYM, 0); - class_addmethod(vslider_class, (t_method)vslider_receive, gensym("receive"), A_DEFSYM, 0); - class_addmethod(vslider_class, (t_method)vslider_label, gensym("label"), A_DEFSYM, 0); - class_addmethod(vslider_class, (t_method)vslider_label_pos, gensym("label_pos"), A_GIMME, 0); - class_addmethod(vslider_class, (t_method)vslider_label_font, gensym("label_font"), A_GIMME, 0); - class_addmethod(vslider_class, (t_method)vslider_log, gensym("log"), 0); - class_addmethod(vslider_class, (t_method)vslider_lin, gensym("lin"), 0); - class_addmethod(vslider_class, (t_method)vslider_init, gensym("init"), A_FLOAT, 0); - class_addmethod(vslider_class, (t_method)vslider_steady, gensym("steady"), A_FLOAT, 0); - vslider_widgetbehavior.w_getrectfn = vslider_getrect; - vslider_widgetbehavior.w_displacefn = iemgui_displace; - vslider_widgetbehavior.w_selectfn = iemgui_select; - vslider_widgetbehavior.w_activatefn = NULL; - vslider_widgetbehavior.w_deletefn = iemgui_delete; - vslider_widgetbehavior.w_visfn = iemgui_vis; - vslider_widgetbehavior.w_clickfn = vslider_newclick; - class_setwidget(vslider_class, &vslider_widgetbehavior); - class_sethelpsymbol(vslider_class, gensym("vslider")); - class_setsavefn(vslider_class, vslider_save); - class_setpropertiesfn(vslider_class, vslider_properties); - } --- 0 ----