Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10361
Modified Files: Tag: impd_0_37 g_all_guis.h g_dropper.c u_main.tk u_object.tk Log Message: aahhhhhhh the colours
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.11 retrieving revision 1.1.1.4.2.2.2.12 diff -C2 -d -r1.1.1.4.2.2.2.11 -r1.1.1.4.2.2.2.12 *** g_all_guis.h 26 Apr 2004 11:37:43 -0000 1.1.1.4.2.2.2.11 --- g_all_guis.h 27 Apr 2004 16:47:32 -0000 1.1.1.4.2.2.2.12 *************** *** 222,231 **** { t_iemgui x_gui; - int x_flashed; - int x_flashtime_break; - int x_flashtime_hold; - t_clock *x_clock_hld; - t_clock *x_clock_brk; - t_clock *x_clock_lck; } t_dropper;
--- 222,225 ----
Index: g_dropper.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/g_dropper.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** g_dropper.c 26 Apr 2004 13:23:07 -0000 1.1.2.2 --- g_dropper.c 27 Apr 2004 16:47:32 -0000 1.1.2.3 *************** *** 45,48 **** --- 45,58 ---- }
+ static void dropper_dialog(t_dropper *x, t_symbol *s, int argc, t_atom *argv) + { + t_symbol *srl[3]; + int a = (int)atom_getintarg(0, argc, argv); + /* int sr_flags = */ iemgui_dialog(&x->x_gui, srl, argc, argv); + x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a); + (*x->x_gui.x_draw)(x, x->x_gui.x_glist, 0); + canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x); + } + static void dropper_save(t_gobj *z, t_binbuf *b) { *************** *** 52,59 ****
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("dropper"), x->x_gui.x_w, - x->x_flashtime_hold, x->x_flashtime_break, iem_symargstoint(&x->x_gui.x_isa), srl[0], srl[1], srl[2], --- 62,68 ----
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, gensym("dropper"), x->x_gui.x_w, iem_symargstoint(&x->x_gui.x_isa), srl[0], srl[1], srl[2], *************** *** 64,67 **** --- 73,97 ---- }
+ static void dropper_properties(t_gobj *z, t_glist *owner) + { + t_dropper *x = (t_dropper *)z; + char buf[800]; + t_symbol *srl[3]; + + iemgui_properties(&x->x_gui, srl); + sprintf(buf, "pdtk_iemgui_dialog %%s dropper \ + ----------dimensions(pix):----------- %d %d size: 0 0 empty \ + empty 0.0 empty 0.0 empty %d \ + %d new-only new&old %d %d number: %d \ + %s %s %s %d %d %d %d %d %d %d\n", + x->x_gui.x_w, IEM_GUI_MINSIZE, 0, + -1, x->x_gui.x_isa.x_loadinit, -1, -1, + 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 dropper_symbol(t_dropper *x, t_symbol *s) { *************** *** 69,87 **** }
- static void dropper_init(t_dropper *x, t_floatarg f) - {x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1;} - static void *dropper_new(t_symbol *s, int argc, t_atom *argv) { char buf[50]; t_dropper *x = (t_dropper *)pd_new(dropper_class); ! int bflcol[]={-262144, -1, -1}; ! int a=IEM_GUI_DEFAULTSIZE; int ldx=0, ldy=-6, isa=0, fstyle=0, fs=8; - int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, - fthold= IEM_BNG_DEFAULTHOLDFLASHTIME; t_symbol *srl[3]={0,0,0}; ! pd_scanargs(argc,argv,"iiiiaaaiiiiiii", ! &a,&fthold,&ftbreak,&isa,&srl[0],&srl[1],&srl[2], &ldx,&ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2]); iem_inttosymargs(&x->x_gui.x_isa, isa); --- 99,112 ---- }
static void *dropper_new(t_symbol *s, int argc, t_atom *argv) { char buf[50]; t_dropper *x = (t_dropper *)pd_new(dropper_class); ! int bflcol[]={-262144, -196672, -1}; ! int a=20; int ldx=0, ldy=-6, isa=0, fstyle=0, fs=8; t_symbol *srl[3]={0,0,0}; ! pd_scanargs(argc,argv,"iiaaaiiiiiii", ! &a,&isa,&srl[0],&srl[1],&srl[2], &ldx,&ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2]); iem_inttosymargs(&x->x_gui.x_isa, isa); *************** *** 92,99 **** x->x_gui.x_ldx=ldx; x->x_gui.x_ldy=ldy; - x->x_flashed = 0; x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0; x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0; iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_fsf.x_font_style); sprintf(buf, "d%x", (int)x); x->x_gui.x_s = gensym(buf); --- 117,125 ---- x->x_gui.x_ldx=ldx; x->x_gui.x_ldy=ldy; x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0; x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0; iemgui_set_font_style((t_iemgui *)x, x->x_gui.x_fsf.x_font_style); + if (x->x_gui.x_fsf.x_rcv_able) + pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); sprintf(buf, "d%x", (int)x); x->x_gui.x_s = gensym(buf); *************** *** 111,115 **** { if(x->x_gui.x_fsf.x_rcv_able) ! pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_s); gfxstub_deleteforkey(x); } --- 137,142 ---- { if(x->x_gui.x_fsf.x_rcv_able) ! pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); ! pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_s); gfxstub_deleteforkey(x); } *************** *** 120,124 **** (t_method)dropper_ff, sizeof(t_dropper), 0, A_GIMME, 0); class_addsymbol(c, dropper_symbol); ! class_addmethod(c, (t_method)dropper_init, gensym("init"), A_FLOAT, 0); iemgui_register_class(c); dropper_widgetbehavior.w_getrectfn = dropper_getrect; --- 147,151 ---- (t_method)dropper_ff, sizeof(t_dropper), 0, A_GIMME, 0); class_addsymbol(c, dropper_symbol); ! class_addmethod(c, (t_method)dropper_dialog, gensym("dialog"), A_GIMME, 0); iemgui_register_class(c); dropper_widgetbehavior.w_getrectfn = dropper_getrect; *************** *** 128,131 **** --- 155,159 ---- dropper_widgetbehavior.w_deletefn = iemgui_delete; dropper_widgetbehavior.w_visfn = iemgui_vis; + class_setpropertiesfn(dropper_class, dropper_properties); class_setwidget(dropper_class, &dropper_widgetbehavior); class_sethelpsymbol(dropper_class, gensym("dropper"));
Index: u_object.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v retrieving revision 1.1.2.24 retrieving revision 1.1.2.25 diff -C2 -d -r1.1.2.24 -r1.1.2.25 *** u_object.tk 27 Apr 2004 13:59:23 -0000 1.1.2.24 --- u_object.tk 27 Apr 2004 16:47:32 -0000 1.1.2.25 *************** *** 53,57 **** set fields(vdl) $fields(hradio) set fields(vu) [eval list $fields1 w h rcv lab ldx ldy fstyle fs bcol lcol scale isa] ! set fields(dropper) [eval list $fields1 w hold break isa $fields2]
proc update_object {x d} { --- 53,57 ---- set fields(vdl) $fields(hradio) set fields(vu) [eval list $fields1 w h rcv lab ldx ldy fstyle fs bcol lcol scale isa] ! set fields(dropper) [eval list $fields1 w isa $fields2]
proc update_object {x d} { *************** *** 808,827 **** set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0] foreach {x1 y1} [object_xy $self $canvas] {} ! set x2 [expr $x1+10 ] ! set y2 [expr $y1+10 ] ! # set xs $_($self:w) ! # set ys $_($self:h) set ins [expr [string compare $_($self:rcv) empty]==0] set outs [expr [string compare $_($self:snd) empty]==0] ! bluebox_draw $self $canvas $x1 $y1 32 24 $ins $outs if {$isnew} { ! canvas $canvas.${self}DROP -width 20 -height 20 -bg purple place $canvas.${self}DROP -x [expr $x1 + 10] -y $y1 dnd bindtarget $canvas.${self}DROP text/uri-list <Drop> "pd "d[list ${self}] symbol [ pdtk_enquote %D ] ;"" } { place $canvas.${self}DROP -x [expr $x1 + 10] -y $y1 } - label_draw $self $canvas - return } --- 808,825 ---- set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0] foreach {x1 y1} [object_xy $self $canvas] {} ! set xs $_($self:w) ! set colour [parse_color $_($self:fcol)] ! set lcolour [parse_color $_($self:lcol)] set ins [expr [string compare $_($self:rcv) empty]==0] set outs [expr [string compare $_($self:snd) empty]==0] ! bluebox_draw $self $canvas $x1 $y1 $xs $xs $ins $outs if {$isnew} { ! canvas $canvas.${self}DROP -width $xs -height $xs -bg $colour -highlightbackground $lcolour -highlightcolor $colour place $canvas.${self}DROP -x [expr $x1 + 10] -y $y1 dnd bindtarget $canvas.${self}DROP text/uri-list <Drop> "pd "d[list ${self}] symbol [ pdtk_enquote %D ] ;"" } { place $canvas.${self}DROP -x [expr $x1 + 10] -y $y1 + $canvas.${self}DROP configure -width $xs -height $xs -bg $colour -highlightbackground $lcolour -highlightcolor $colour } return }
Index: u_main.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v retrieving revision 1.1.1.4.2.7.4.49 retrieving revision 1.1.1.4.2.7.4.50 diff -C2 -d -r1.1.1.4.2.7.4.49 -r1.1.1.4.2.7.4.50 *** u_main.tk 27 Apr 2004 13:59:22 -0000 1.1.1.4.2.7.4.49 --- u_main.tk 27 Apr 2004 16:47:32 -0000 1.1.1.4.2.7.4.50 *************** *** 255,259 **** set pd_opendir $directory set basename [string range $filename [expr [string last / $filename] + 1] end] ! pd "pd open [pdtk_enquote $basename] [pdtk_enquote $directory] ;" }
--- 255,261 ---- set pd_opendir $directory set basename [string range $filename [expr [string last / $filename] + 1] end] ! if {[string last .pd $filename] >= 0} { ! pd "pd open [pdtk_enquote $basename] [pdtk_enquote $directory] ;" ! } }