Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1833
Modified Files: Tag: devel_0_39 desire.c Log Message: deleting dead code from desire.c (widgetbehavior, etc)
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** desire.c 10 Sep 2005 05:59:56 -0000 1.1.2.6 --- desire.c 10 Sep 2005 06:22:25 -0000 1.1.2.7 *************** *** 121,138 ****
static int iemgui_clip_size(int size); - static int iemgui_clip_font(int size); - static t_symbol *iemgui_new_dogetname(t_iemgui *iemgui, int indx, t_atom *argv); static void iemgui_size(t_iemgui *x); - - /* adds the aforementioned methods to a iemgui class (pd has no inheritance) */ static void iemgui_subclass (t_class *c); - - /* widgetbehaviour */ - static void iemgui_displace(t_gobj *z, t_glist *glist, int dx, int dy); - static void iemgui_select(t_gobj *z, t_glist *glist, int selected); - static void iemgui_delete(t_gobj *z, t_glist *glist); - static void iemgui_vis(t_gobj *z, t_glist *glist, int vis); - - /* miscellaneous */ void sys_mgui(t_gobj *self, const char *sel, const char *fmt, ...); t_iemgui *iemgui_new(t_class *qlass); --- 121,126 ---- *************** *** 196,200 **** t_text *x = (t_text *)pd_new(text_class); t_atom at; ! sys_vgui("global _; set _(%x:canvas) .%lx.c\n",(long)x,(long)gl); x->te_width = 0; /* don't know it yet. */ x->te_type = T_TEXT; --- 184,188 ---- t_text *x = (t_text *)pd_new(text_class); t_atom at; ! sys_vgui("global _; set _(%x:canvas) .x%lx.c\n",(long)x,(long)gl); x->te_width = 0; /* don't know it yet. */ x->te_type = T_TEXT; *************** *** 240,246 **** void canvas_getargs(int *argcp, t_atom **argvp);
! static void canvas_objtext(t_glist *gl, int xpix, int ypix, int selected, ! t_binbuf *b) ! { t_text *x=0; int argc; --- 228,232 ---- void canvas_getargs(int *argcp, t_atom **argvp);
! static void canvas_objtext(t_glist *gl, int xpix, int ypix, int selected, t_binbuf *b) { t_text *x=0; int argc; *************** *** 260,264 **** } if (!x) x = (t_text *)pd_new(text_class); ! sys_vgui("global _; set _(%x:canvas) .%lx.c\n",(long)x,(long)gl); x->te_binbuf = b; x->te_xpix = xpix; --- 246,250 ---- } if (!x) x = (t_text *)pd_new(text_class); ! sys_vgui("global _; set _(%x:canvas) .x%lx.c\n",(long)x,(long)gl); x->te_binbuf = b; x->te_xpix = xpix; *************** *** 277,286 ****
/* object creation routine. These are called without any arguments if ! they're invoked from the ! gui; when pasting or restoring from a file, we get at least x and y. */ ! ! void canvas_obj(t_glist *gl, t_symbol *s, int argc, t_atom *argv) ! { ! t_text *x; t_binbuf *b = binbuf_new(); if (argc >= 2) { --- 263,268 ----
/* object creation routine. These are called without any arguments if ! they're invoked from the gui; when pasting or restoring from a file, we get at least x and y. */ ! void canvas_obj(t_glist *gl, t_symbol *s, int argc, t_atom *argv) { t_binbuf *b = binbuf_new(); if (argc >= 2) { *************** *** 670,675 **** /* for numbers, only let reasonable characters through */ if ((x->a_atom.a_type == A_SYMBOL) || ! (c >= '0' && c <= '9' || c == '.' || c == '-' ! || c == 'e' || c == 'E')) { x->a_buf[len] = c; --- 652,656 ---- /* for numbers, only let reasonable characters through */ if ((x->a_atom.a_type == A_SYMBOL) || ! (c >= '0' && c <= '9') || c == '.' || c == '-' || c == 'e' || c == 'E') { x->a_buf[len] = c; *************** *** 770,834 **** }
- /* ---------------- gatom-specific widget functions --------------- */ - static void gatom_getwherelabel(t_gatom *x, t_glist *glist, int *xp, int *yp) - { - int x1, y1, x2, y2, width, height; - text_getrect(&x->a_text.te_g, glist, &x1, &y1, &x2, &y2); - width = x2 - x1; - height = y2 - y1; - if (x->a_wherelabel == ATOM_LABELLEFT) - { - *xp = x1 - 3 - - strlen(canvas_realizedollar(x->a_glist, x->a_label)->s_name) * - sys_fontwidth(glist_getfont(glist)); - *yp = y1 + 2; - } - else if (x->a_wherelabel == ATOM_LABELRIGHT) - { - *xp = x2 + 2; - *yp = y1 + 2; - } - else if (x->a_wherelabel == ATOM_LABELUP) - { - *xp = x1 - 1; - *yp = y1 - 1 - sys_fontheight(glist_getfont(glist));; - } - else - { - *xp = x1 - 1; - *yp = y2 + 3; - } - } - - static void gatom_displace(t_gobj *z, t_glist *glist, - int dx, int dy) - { - t_gatom *x = (t_gatom*)z; - text_displace(z, glist, dx, dy); - sys_vgui(".x%x.c move %x.l %d %d\n", glist_getcanvas(glist), - x, dx, dy); - } - - static void gatom_vis(t_gobj *z, t_glist *glist, int vis) - { - t_gatom *x = (t_gatom*)z; - text_vis(z, glist, vis); - if (*x->a_label->s_name) - { - if (vis) - { - int x1, y1; - gatom_getwherelabel(x, glist, &x1, &y1); - sys_vgui("pdtk_text_new .x%x.c %x.l %f %f {%s} %d %s\n", - glist_getcanvas(glist), x, - (double)x1, (double)y1, - canvas_realizedollar(x->a_glist, x->a_label)->s_name, - sys_hostfontsize(glist_getfont(glist)), - "black"); - } - else sys_vgui(".x%x.c delete %x.l\n", glist_getcanvas(glist), x); - } - } - void canvas_atom(t_glist *gl, t_atomtype type, t_symbol *s, int argc, t_atom *argv) --- 751,754 ---- *************** *** 970,974 **** static void text_vis(t_gobj *z, t_glist *glist, int vis) { t_text *x = (t_text *)z; - t_rtext *y = glist_findrtext(glist, x); if (vis) { if (text_shouldvis(x, glist)) {if (vis) pd_changed(x); else sys_mgui(z,"erase","");} --- 890,893 ---- *************** *** 1181,1185 **** /* draw inlets/outlets */
! if (ob = pd_checkobject(&x->te_pd)) glist_drawiofor(glist, ob, firsttime, tag, x1, y1, x2, y2); } --- 1100,1104 ---- /* draw inlets/outlets */
! if ((ob = pd_checkobject(&x->te_pd))) glist_drawiofor(glist, ob, firsttime, tag, x1, y1, x2, y2); } *************** *** 1313,1330 **** int iemgui_clip_size(int size) {return MAX(8,size);} - int iemgui_clip_font(int size) {return MAX(4,size);} - - t_symbol *iemgui_new_dogetname(t_iemgui *iemgui, int indx, t_atom *argv) - { - if (IS_A_SYMBOL(argv, indx)) - return (atom_getsymbolarg(indx, 100000, argv)); - else if (IS_A_FLOAT(argv, indx)) - { - char str[80]; - sprintf(str, "%d", (int)atom_getintarg(indx, 100000, argv)); - return (gensym(str)); - } - else return (gensym("empty")); - }
int convert_color2(int x) { --- 1232,1235 ---- *************** *** 1412,1446 **** }
- void iemgui_displace(t_gobj *z, t_glist *glist, int dx, int dy) - { - t_iemgui *x = (t_iemgui *)z; - x->obj.te_xpix += dx; - x->obj.te_ypix += dy; - pd_changed(z); - canvas_fixlinesfor(glist_getcanvas(glist), (t_text *)z); - } - - void iemgui_select(t_gobj *z, t_glist *glist, int selected) - {sys_vgui("canvas_select_object .x%x %x %d; ",glist,z,selected); pd_changed(z);} - - 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) { - if (vis) pd_changed(z); else sys_mgui(z,"erase",""); - } - - /*int iemgui_dialog(t_iemgui *x, t_symbol **srl, int argc, t_atom *argv) { - if(rcvable) { - if(srl[1]==x->rcv)) { - if(x->rcv_able) pd_unbind((t_pd *)x, x->rcv); - x->rcv = srl[1]; pd_bind((t_pd *)x, x->rcv); - } - } else if(!rcvable && x->rcv_able) { - pd_unbind((t_pd *)x, x->rcv); x->rcv = srl[1]; - } - x->snd = srl[0]; x->lab = srl[2]; return 0;} - */ - static int pd_scanargs(int argc, t_atom *argv, char *fmt, ...) { int i=0; --- 1317,1320 ---- *************** *** 1664,1677 **** }
- static void iemgui_getrect(t_gobj *z, t_glist *glist, - int *xp1, int *yp1, int *xp2, int *yp2) - { - t_iemgui* x = (t_iemgui*)z; - *xp1 = text_xpix((t_text *)x,glist); - *yp1 = text_ypix((t_text *)x,glist); - *xp2 = *xp1+x->w; - *yp2 = *yp1+x->h; - } - static t_class *bng_class;
--- 1538,1541 ---- *************** *** 1726,1733 **** }
- static void bng_tick_hld(t_bng *x) {x->flashed = 0;} - static void bng_tick_brk(t_bng *x) {} - static void bng_tick_lck(t_bng *x) {x->locked = 0;} - static int bng_pickle(t_bng *x, t_foo *foo) { return pd_pickle(foo,"iiiiaaaiiiiccc", --- 1590,1593 ---- *************** *** 1889,1901 **** }
- static void radio_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2) - { - t_radio *x = (t_radio *)z; - *xp1 = text_xpix((t_text *)x, glist); - *yp1 = text_ypix((t_text *)x, glist); - *xp2 = *xp1 + x->w*(isvert(x)?1:x->number); - *yp2 = *yp1 + x->h*(isvert(x)?x->number:1); - } - static void radio_set(t_radio *x, t_floatarg f) { --- 1749,1752 ---- *************** *** 2076,2088 **** #define IEM_SL_MINSIZE 2
- static void slider_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2) - { - t_slider* x = (t_slider*)z; - *xp1 = text_xpix((t_text *)x, glist) - (isvert(x)?0:3); - *yp1 = text_ypix((t_text *)x, glist) - (isvert(x)?2:0); - *xp2 = *xp1 + x->w + (isvert(x)?0:5); - *yp2 = *yp1 + x->h + (isvert(x)?5:0); - } - static void slider_check_width(t_slider *x, int w) { --- 1927,1930 ---- *************** *** 2234,2248 **** static t_class *nbclass;
- /* widget helper functions */ - - static void nbtick_reset(t_nbx *x) - { - if(!x->change) return; - x->change = 0; CH - glist_grab(x->glist, 0, 0, 0, 0, 0); - pd_changed(x); - } - - static void nbtick_wait(t_nbx *x) {pd_changed(x);} void nbclip(t_nbx *x) {CLAMP(x->val,x->min,x->max);}
--- 2076,2079 ---- *************** *** 2255,2268 **** }
- static void nbgetrect(t_gobj *z, t_glist *glist, - int *xp1, int *yp1, int *xp2, int *yp2) - { - t_nbx* x = (t_nbx*)z; - *xp1 = text_xpix((t_text *)x, glist); - *yp1 = text_ypix((t_text *)x, glist); - *xp2 = *xp1 + x->numwidth; - *yp2 = *yp1 + x->h; - } - int nbcheck_minmax(t_nbx *x) { --- 2086,2089 ---- *************** *** 2288,2300 **** }
- static void nbmotion(t_nbx *x, t_floatarg dx, t_floatarg dy) - { - double k2= x->finemoved ? 0.01 : 1.0; - if(x->is_log) x->val *= pow(x->k, -k2*dy); else x->val -= k2*dy; - nbclip(x); - pd_changed(x); - nbbang(x); - } - static void nbset(t_nbx *x, t_floatarg f) {x->val=f; nbclip(x); pd_changed(x);} --- 2109,2112 ---- *************** *** 2437,2450 **** {if(glist_isvisible(glist)) sys_mgui((t_gobj *)x,"set","ii",x->rms,x->peak);}
- static void vu_getrect(t_gobj *z, t_glist *glist, - int *xp1, int *yp1, int *xp2, int *yp2) - { - t_vu* x = (t_vu*)z; - *xp1 = text_xpix((t_text *)x, glist) - 1; - *yp1 = text_ypix((t_text *)x, glist) - 2; - *xp2 = *xp1 + x->w + 2; - *yp2 = *yp1 + x->h + 4; - } - static void vu_check_height(t_vu *x, int h) { --- 2249,2252 ----