Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30267
Modified Files: Tag: impd_0_37 u_main.tk u_object.tk g_bang.c g_dropper.c g_hdial.c g_hslider.c g_mycanvas.c g_numbox.c g_toggle.c g_vumeter.c x_gui.c m_pd.h Log Message: changed client-server comm in property dialogs (part 2)
Index: g_toggle.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_toggle.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_toggle.c 3 May 2004 04:34:30 -0000 1.1.1.3.2.2.2.15 --- g_toggle.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.16 *************** *** 66,77 **** { t_toggle *x = (t_toggle *)z; ! char buf[800]; pd_upload((t_gobj *)x,owner); ! sprintf(buf, "pdtk_iemgui_dialog %%s TOGGLE \ ! ----------dimensions(pix):----------- %d 8 size: 0 0 empty \ ! -----------non-zero-value:----------- %g value: 0.0 empty 1.0 \ ! lin log empty -1 %x\n", ! x->x_gui.x_w, x->x_nonzero, x); ! gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); }
--- 66,74 ---- { t_toggle *x = (t_toggle *)z; ! t_symbol *stub = gfxstub_new((t_pd *)x,x,0); pd_upload((t_gobj *)x,owner); ! sys_vgui("pdtk_iemgui_dialog %s dimensions(pix): %d 8 size: 0 0 empty \ ! non-zero-value: value: empty 1.0 lin log empty -1 %x\n", ! stub->s_name, x->x_gui.x_w, x); }
Index: g_hdial.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v retrieving revision 1.1.1.4.2.2.2.17 retrieving revision 1.1.1.4.2.2.2.18 diff -C2 -d -r1.1.1.4.2.2.2.17 -r1.1.1.4.2.2.2.18 *** g_hdial.c 3 May 2004 04:34:30 -0000 1.1.1.4.2.2.2.17 --- g_hdial.c 3 May 2004 05:37:15 -0000 1.1.1.4.2.2.2.18 *************** *** 76,86 **** { t_hradio *x = (t_hradio *)z; ! char buf[800]; pd_upload((t_gobj *)x,owner); ! sprintf(buf, "pdtk_iemgui_dialog %%s hradio \ ! ----------dimensions(pix):----------- %d 8 size: 0 0 empty \ ! empty 0.0 empty 0.0 empty 0 new-only new&old number: %d %x\n", ! x->x_gui.x_w, x->x_number, x); ! gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); }
--- 76,84 ---- { t_hradio *x = (t_hradio *)z; ! t_symbol *stub = gfxstub_new((t_pd *)x,x,0); pd_upload((t_gobj *)x,owner); ! sys_vgui("pdtk_iemgui_dialog %s dimensions(pix): %d 8 size: 0 0 empty \ ! empty empty empty 0 new-only new&old number: %d %x\n", ! stub->s_name, x->x_gui.x_w, x->x_number, x); }
Index: u_main.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v retrieving revision 1.1.1.4.2.7.4.56 retrieving revision 1.1.1.4.2.7.4.57 diff -C2 -d -r1.1.1.4.2.7.4.56 -r1.1.1.4.2.7.4.57 *** u_main.tk 3 May 2004 04:34:52 -0000 1.1.1.4.2.7.4.56 --- u_main.tk 3 May 2004 05:37:13 -0000 1.1.1.4.2.7.4.57 *************** *** 1545,1558 **** set self [string trimleft $id .] if {$_($self:rng_sch) == 2} { ! if {$_($self:max_rng) < $_($self:min_rng)} { ! set tmp $_($self:min_rng) ! set _($self:min_rng) $_($self:max_rng) ! set _($self:max_rng) $tmp } ! if {$_($self:max_rng) < 50} {set _($self:max_rng) 50} ! if {$_($self:min_rng) < 10} {set _($self:min_rng) 10} } if {$_($self:rng_sch) == 1} { ! if {$_($self:min_rng) == 0.0} {set _($self:min_rng) 1.0} } } --- 1545,1558 ---- set self [string trimleft $id .] if {$_($self:rng_sch) == 2} { ! if {$_($self:max) < $_($self:min)} { ! set tmp $_($self:min) ! set _($self:min) $_($self:max) ! set _($self:max) $tmp } ! if {$_($self:max) < 50} {set _($self:max) 50} ! if {$_($self:min) < 10} {set _($self:min) 10} } if {$_($self:rng_sch) == 1} { ! if {$_($self:min) == 0.0} {set _($self:min) 1.0} } } *************** *** 1562,1572 **** set self [string trimleft $id .] if {$_($self:is_log) == 1} { ! if {$_($self:max_rng) == 0.0 && $_($self:min_rng) == 0.0} { ! set _($self:max_rng) 1.0 } ! if {$_($self:max_rng) > 0} { ! if {$_($self:min_rng) <= 0} {set _($self:min_rng) [expr $_($self:max_rng) * 0.01]} } else { ! if {$_($self:min_rng) > 0} {set _($self:max_rng) [expr $_($self:min_rng) * 0.01]} } } --- 1562,1572 ---- set self [string trimleft $id .] if {$_($self:is_log) == 1} { ! if {$_($self:max) == 0.0 && $_($self:min) == 0.0} { ! set _($self:max) 1.0 } ! if {$_($self:max) > 0} { ! if {$_($self:min) <= 0} {set _($self:min) [expr $_($self:max) * 0.01]} } else { ! if {$_($self:min) > 0} {set _($self:max) [expr $_($self:min) * 0.01]} } } *************** *** 1598,1602 **** pd "$id dialog \ $_($self:w) $_($self:h) \ ! $_($self:min_rng) $_($self:max_rng) \ $_($self:is_log) $_($self:loadbang) \ $_($self:num) $snd $rcv $lab \ --- 1598,1602 ---- pd "$id dialog \ $_($self:w) $_($self:h) \ ! $_($self:min) $_($self:max) \ $_($self:is_log) $_($self:loadbang) \ $_($self:num) $snd $rcv $lab \ *************** *** 1612,1630 **** }
! proc pdtk_iemgui_dialog {id mainheader \ ! dim_header w min_w w_label h min_h h_label \ ! rng_header min_rng min_rng_label max_rng max_rng_label rng_sched \ ! lilo0_label lilo1_label num_label num obj} { ! global _ set self [string trimleft $id .] set _($self:w) $w; set _($self:min_w) $min_w set _($self:h) $h; set _($self:min_h) $min_h - set _($self:min_rng) $min_rng - set _($self:max_rng) $max_rng set _($self:rng_sch) $rng_sched set _($self:lilo0) $lilo0_label set _($self:lilo1) $lilo1_label set _($self:num) $num ! foreach var {snd rcv lab} { set val nosndno --- 1612,1626 ---- }
! proc pdtk_iemgui_dialog {id dim_header w min_w w_label h min_h h_label \ ! rng_header min_label max_label rng_sched lilo0_label lilo1_label num_label num obj} { ! global _ classinfo set self [string trimleft $id .] set _($self:w) $w; set _($self:min_w) $min_w set _($self:h) $h; set _($self:min_h) $min_h set _($self:rng_sch) $rng_sched set _($self:lilo0) $lilo0_label set _($self:lilo1) $lilo1_label set _($self:num) $num ! # x->x_flashtime_break, x->x_flashtime_hold foreach var {snd rcv lab} { set val nosndno *************** *** 1635,1639 **** set _($self:$var) $_($obj:$var) } ! foreach var {bcol fcol lcol is_log steady} { set _($self:$var) -1 catch {set _($self:$var) [parse_color $_($obj:$var)]} --- 1631,1635 ---- set _($self:$var) $_($obj:$var) } ! foreach var {bcol fcol lcol is_log steady min max} { set _($self:$var) -1 catch {set _($self:$var) [parse_color $_($obj:$var)]} *************** *** 1642,1646 **** puts "pdtk_iemgui_dialog $id ..." toplevel $id ! wm title $id [format "%s-PROPERTIES" $mainheader] wm protocol $id WM_DELETE_WINDOW "iemgui_cancel $id" set props {} --- 1638,1642 ---- puts "pdtk_iemgui_dialog $id ..." toplevel $id ! wm title $id "$classinfo($_($obj:class)) Properties" wm protocol $id WM_DELETE_WINDOW "iemgui_cancel $id" set props {} *************** *** 1654,1662 **** #$rng_header if {$rng_header != "empty"} { ! if {$min_rng_label != "empty"} { ! lappend props min_rng "${min_rng_label}: " entry {-width 9} } ! if {$max_rng_label != "empty"} { ! lappend props max_rng "${max_rng_label}: " entry {-width 9} } } --- 1650,1658 ---- #$rng_header if {$rng_header != "empty"} { ! if {$min_label != "empty"} { ! lappend props min "${min_label}: " entry {-width 9} } ! if {$max_label != "empty"} { ! lappend props max "${max_label}: " entry {-width 9} } }
Index: g_mycanvas.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_mycanvas.c,v retrieving revision 1.1.1.3.2.2.2.9 retrieving revision 1.1.1.3.2.2.2.10 diff -C2 -d -r1.1.1.3.2.2.2.9 -r1.1.1.3.2.2.2.10 *** g_mycanvas.c 3 May 2004 04:34:30 -0000 1.1.1.3.2.2.2.9 --- g_mycanvas.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.10 *************** *** 59,70 **** { t_my_canvas *x = (t_my_canvas *)z; ! char buf[800]; pd_upload((t_gobj *)x,owner); ! sprintf(buf, "pdtk_iemgui_dialog %%s MY_CANVAS \ ! ------selectable_dimensions(pix):------ %d %d size: 0.0 0.0 empty \ ! ------visible_rectangle(pix)(pix):------ %d width: %d height: 0 \ ! empty empty empty -1 %x\n", ! x->x_gui.x_w, 1, x->x_vis_w, x->x_vis_h, 0, x); ! gfxstub_new((t_pd *)x, x, buf); }
--- 59,67 ---- { t_my_canvas *x = (t_my_canvas *)z; ! t_symbol *stub = gfxstub_new((t_pd *)x,x,0); pd_upload((t_gobj *)x,owner); ! sys_vgui("pdtk_iemgui_dialog %s selectable_dimensions(pix): %d %d size: 0.0 0.0 empty \ ! visible_rectangle(pix)(pix): %d width: %d height: 0 empty empty empty -1 %x\n", ! stub->s_name, x->x_gui.x_w, 1, x->x_vis_w, x->x_vis_h, x); }
Index: u_object.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v retrieving revision 1.1.2.31 retrieving revision 1.1.2.32 diff -C2 -d -r1.1.2.31 -r1.1.2.32 *** u_object.tk 3 May 2004 02:51:44 -0000 1.1.2.31 --- u_object.tk 3 May 2004 05:37:13 -0000 1.1.2.32 *************** *** 43,58 **** # real classes set fields(obj) [eval list $fields1] ! set fields(tgl) [eval list $fields1 w isa $fields2 on nonzero] ! set fields(bng) [eval list $fields1 w hold break isa $fields2] ! set fields(nbx) [eval list $fields1 w h min max is_log isa $fields2 val log_height] ! set fields(hsl) [eval list $fields1 w h min max is_log isa $fields2 val steady] ! set fields(hradio) [eval list $fields1 w change isa n $fields2 on] set fields(vsl) $fields(hsl) set fields(vradio) $fields(hradio) set fields(hdl) $fields(hradio) 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(cnv) [eval list $fields1 hh w h snd rcv lab ldx ldy fstyle fs bcol lcol isa] ! set fields(dropper) [eval list $fields1 w isa $fields2]
proc update_object {x d} { --- 43,72 ---- # real classes set fields(obj) [eval list $fields1] ! set fields(tgl) [eval list $fields1 w isa $fields2 on nonzero] ! set fields(bng) [eval list $fields1 w hold break isa $fields2] ! set fields(nbx) [eval list $fields1 w h min max is_log isa $fields2 val log_height] ! set fields(hsl) [eval list $fields1 w h min max is_log isa $fields2 val steady] ! set fields(hradio) [eval list $fields1 w change isa n $fields2 on] ! set fields(vu) [eval list $fields1 w h rcv lab ldx ldy fstyle fs bcol lcol scale isa] ! set fields(cnv) [eval list $fields1 hh w h snd rcv lab ldx ldy fstyle fs bcol lcol isa] ! set fields(dropper) [eval list $fields1 w isa $fields2] set fields(vsl) $fields(hsl) set fields(vradio) $fields(hradio) set fields(hdl) $fields(hradio) set fields(vdl) $fields(hradio) ! ! set classinfo(obj) {Object} ! set classinfo(tgl) {Toggle} ! set classinfo(bng) {Bang} ! set classinfo(nbx) {Numberbox} ! set classinfo(hsl) {Slider} ! set classinfo(hradio) {Radiobutton} ! set classinfo(vu) {Vumeter} ! set classinfo(cnv) {Canvas} ! set classinfo(dropper) {Dropper} ! set classinfo(vsl) $classinfo(hsl) ! set classinfo(vradio) $classinfo(hradio) ! set classinfo(hdl) $classinfo(hradio) ! set classinfo(vdl) $classinfo(hradio)
proc update_object {x d} {
Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.1.1.4.2.10.2.6 retrieving revision 1.1.1.4.2.10.2.7 diff -C2 -d -r1.1.1.4.2.10.2.6 -r1.1.1.4.2.10.2.7 *** m_pd.h 25 Apr 2004 23:11:48 -0000 1.1.1.4.2.10.2.6 --- m_pd.h 3 May 2004 05:37:15 -0000 1.1.1.4.2.10.2.7 *************** *** 9,12 **** --- 9,14 ---- #endif
+ #define MATJU1 + #define PD_VERSION 0.37 /* oops, don't use this... */ */ #define PD_MAJOR_VERSION 0 /* ... use these two instead. */ *************** *** 583,587 **** EXTERN void sys_vgui(char *fmt, ...) #ifdef __GNUC__ ! __attribute__ ((format (printf,1,2))) #endif ; --- 585,589 ---- EXTERN void sys_vgui(char *fmt, ...) #ifdef __GNUC__ ! /*__attribute__ ((format (printf,1,2)))*/ #endif ; *************** *** 590,594 ****
/* dialog window creation and destruction */ ! EXTERN void gfxstub_new(t_pd *owner, void *key, const char *cmd); EXTERN void gfxstub_deleteforkey(void *key);
--- 592,596 ----
/* dialog window creation and destruction */ ! EXTERN t_symbol *gfxstub_new(t_pd *owner, void *key, const char *cmd); EXTERN void gfxstub_deleteforkey(void *key);
Index: g_numbox.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v retrieving revision 1.1.1.4.2.2.2.14 retrieving revision 1.1.1.4.2.2.2.15 diff -C2 -d -r1.1.1.4.2.2.2.14 -r1.1.1.4.2.2.2.15 *** g_numbox.c 3 May 2004 04:34:30 -0000 1.1.1.4.2.2.2.14 --- g_numbox.c 3 May 2004 05:37:15 -0000 1.1.1.4.2.2.2.15 *************** *** 187,191 **** { t_my_numbox *x = (t_my_numbox *)z; ! char buf[800]; t_symbol *srl[3];
--- 187,191 ---- { t_my_numbox *x = (t_my_numbox *)z; ! t_symbol *stub = gfxstub_new((t_pd *)x,x,0); t_symbol *srl[3];
*************** *** 197,206 **** x->x_gui.x_draw(x, x->x_gui.x_glist, 0); } ! sprintf(buf, "pdtk_iemgui_dialog %%s NUMBERBOX \ ! -------dimensions(digits)(pix):------- %d 1 width: %d 8 height: \ ! -----------output-range:----------- %g min: %g max: 0 \ ! lin log log-height: %d %x\n", ! x->x_gui.x_w, x->x_gui.x_h, x->x_min, x->x_max, x->x_log_height, x); ! gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); }
--- 197,203 ---- x->x_gui.x_draw(x, x->x_gui.x_glist, 0); } ! sys_vgui("pdtk_iemgui_dialog %s dimensions(digits)(pix): %d 1 width: %d 8 height: \ ! output-range: %g min: %g max: 0 lin log log-height: %d %x\n", ! stub->s_name, x->x_gui.x_w, x->x_gui.x_h, x->x_min, x->x_max, x->x_log_height, x); }
Index: g_vumeter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_vumeter.c,v retrieving revision 1.1.1.3.2.2.2.13 retrieving revision 1.1.1.3.2.2.2.14 diff -C2 -d -r1.1.1.3.2.2.2.13 -r1.1.1.3.2.2.2.14 *** g_vumeter.c 3 May 2004 04:34:30 -0000 1.1.1.3.2.2.2.13 --- g_vumeter.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.14 *************** *** 104,109 **** void vu_check_height(t_vu *x, int h) { ! int n = h / IEM_VU_STEPS; ! if(n < IEM_VU_MINSIZE) n = IEM_VU_MINSIZE; x->x_led_size = n-1; x->x_gui.x_h = IEM_VU_STEPS * n; --- 104,109 ---- void vu_check_height(t_vu *x, int h) { ! int n=h/IEM_VU_STEPS; ! n = MAX(n,IEM_VU_MINSIZE); x->x_led_size = n-1; x->x_gui.x_h = IEM_VU_STEPS * n; *************** *** 116,126 **** { t_vu *x = (t_vu *)z; ! char buf[800]; pd_upload((t_gobj *)x,owner); ! sprintf(buf, "pdtk_iemgui_dialog %%s VU-METER \ ! --------dimensions(pix)(pix):-------- %d 8 width: %d %d height: \ empty 0.0 empty 0.0 empty 0 no_scale scale empty -1 %x\n", ! x->x_gui.x_w, x->x_gui.x_h, 8*IEM_VU_STEPS, x); ! gfxstub_new((t_pd *)x,x,buf); }
--- 116,124 ---- { t_vu *x = (t_vu *)z; ! t_symbol *stub = gfxstub_new((t_pd *)x,x,0); pd_upload((t_gobj *)x,owner); ! sys_vgui("pdtk_iemgui_dialog %s dimensions(pix)(pix): %d 8 width: %d 80 height: \ empty 0.0 empty 0.0 empty 0 no_scale scale empty -1 %x\n", ! stub->s_name, x->x_gui.x_w, x->x_gui.x_h, x); }
*************** *** 146,151 **** x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); if(ac > 1) vu_check_height(x, (int)atom_getintarg(1, ac, av)); ! if(glist_isvisible(x->x_gui.x_glist)) ! { x->x_gui.x_draw(x, x->x_gui.x_glist, 0); canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x); --- 144,148 ---- x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); if(ac > 1) vu_check_height(x, (int)atom_getintarg(1, ac, av)); ! if(glist_isvisible(x->x_gui.x_glist)) { x->x_gui.x_draw(x, x->x_gui.x_glist, 0); canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
Index: g_hslider.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v retrieving revision 1.1.1.3.2.2.2.19 retrieving revision 1.1.1.3.2.2.2.20 diff -C2 -d -r1.1.1.3.2.2.2.19 -r1.1.1.3.2.2.2.20 *** g_hslider.c 3 May 2004 04:34:30 -0000 1.1.1.3.2.2.2.19 --- g_hslider.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.20 *************** *** 111,123 **** { t_hslider *x = (t_hslider *)z; ! char buf[800]; pd_upload((t_gobj *)x,owner); ! sprintf(buf, "pdtk_iemgui_dialog %%s HSLIDER \ ! --------dimensions(pix)(pix):-------- %d 8 width: %d 8 height: \ ! -----------output-range:----------- %g left: %g right: %g \ ! lin log empty -1 %x\n", ! x->x_gui.x_w, x->x_gui.x_h, ! x->x_min, x->x_max, 0.0, x); ! gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); }
--- 111,119 ---- { t_hslider *x = (t_hslider *)z; ! t_symbol *stub = gfxstub_new((t_pd *)x,x,0); pd_upload((t_gobj *)x,owner); ! sys_vgui("pdtk_iemgui_dialog %s dimensions(pix)(pix): %d 8 width: %d 8 height: \ ! output-range: left: right: 0.0 lin log empty -1 %x\n", ! stub->s_name, x->x_gui.x_w, x->x_gui.x_h, x); }
Index: g_dropper.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/g_dropper.c,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -C2 -d -r1.1.2.9 -r1.1.2.10 *** g_dropper.c 3 May 2004 04:34:30 -0000 1.1.2.9 --- g_dropper.c 3 May 2004 05:37:15 -0000 1.1.2.10 *************** *** 51,55 **** /* 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); } --- 51,55 ---- /* 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); } *************** *** 78,86 **** char buf[800]; pd_upload((t_gobj *)x,owner); ! sprintf(buf, "pdtk_iemgui_dialog %%s BANG " ! "----------dimensions(pix):----------- %d 8 size: 0 0 empty " ! "--------flash-time(ms)(ms):--------- %d intrrpt: %d hold: 2 " ! "empty empty empty -1 %x\n", ! x->x_gui.x_w, -1, -1, x); gfxstub_new((t_pd *)x,x,buf); } --- 78,84 ---- char buf[800]; pd_upload((t_gobj *)x,owner); ! sprintf(buf, "pdtk_iemgui_dialog %%s DROPPER dimensions(pix): %d 8 size: 0 0 empty " ! "flash-time(ms)(ms): intrrpt: hold: 2 empty empty empty -1 %x\n", ! x->x_gui.x_w, x); gfxstub_new((t_pd *)x,x,buf); }
Index: g_bang.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v retrieving revision 1.1.1.3.2.2.2.19 retrieving revision 1.1.1.3.2.2.2.20 diff -C2 -d -r1.1.1.3.2.2.2.19 -r1.1.1.3.2.2.2.20 *** g_bang.c 3 May 2004 04:34:30 -0000 1.1.1.3.2.2.2.19 --- g_bang.c 3 May 2004 05:37:15 -0000 1.1.1.3.2.2.2.20 *************** *** 70,93 **** { t_bng *x = (t_bng *)z; ! char buf[800]; pd_upload((t_gobj *)x,owner); ! sprintf(buf, "pdtk_iemgui_dialog %%s BANG " ! "----------dimensions(pix):----------- %d 8 size: 0 0 empty " ! "--------flash-time(ms)(ms):--------- %d intrrpt: %d hold: 2 " ! "empty empty empty -1 %x\n", ! x->x_gui.x_w, x->x_flashtime_break, x->x_flashtime_hold, x); ! gfxstub_new((t_pd *)x,x,buf); }
static void bng_set(t_bng *x) { ! if(x->x_flashed) ! { x->x_flashed = 0; clock_delay(x->x_clock_brk, x->x_flashtime_break); } else { t_canvas *glist = ((t_iemgui *)x)->x_glist; ! if (glist_isvisible(glist_getcanvas(glist))) ! sys_mgui((t_iemgui *)x,"bang","bang",""); } x->x_flashed = 1; --- 70,88 ---- { t_bng *x = (t_bng *)z; ! t_symbol *stub = gfxstub_new((t_pd *)x,x,0); pd_upload((t_gobj *)x,owner); ! sys_vgui("pdtk_iemgui_dialog %s dimensions(pix): %d 8 size: 0 0 empty " ! "flash-time(ms)(ms): intrrpt: hold: 2 empty empty empty -1 %x\n", ! stub->s_name, x->x_gui.x_w, x); }
static void bng_set(t_bng *x) { ! if(x->x_flashed) { x->x_flashed = 0; clock_delay(x->x_clock_brk, x->x_flashtime_break); } else { t_canvas *glist = ((t_iemgui *)x)->x_glist; ! if (glist_isvisible(glist_getcanvas(glist))) sys_mgui((t_iemgui *)x,"bang","bang",""); } x->x_flashed = 1; *************** *** 97,105 **** static void bng_bout2(t_bng *x) { ! if(!x->x_gui.x_put_in2out) ! {x->x_gui.x_locked = 1; clock_delay(x->x_clock_lck, 2);} outlet_bang(x->x_gui.x_obj.ob_outlet); ! if(x->x_gui.x_snd_able && x->x_gui.x_snd->s_thing) ! pd_bang(x->x_gui.x_snd->s_thing); }
--- 92,98 ---- static void bng_bout2(t_bng *x) { ! if(!x->x_gui.x_put_in2out) {x->x_gui.x_locked = 1; clock_delay(x->x_clock_lck, 2);} outlet_bang(x->x_gui.x_obj.ob_outlet); ! if(x->x_gui.x_snd_able && x->x_gui.x_snd->s_thing) pd_bang(x->x_gui.x_snd->s_thing); }
*************** *** 108,116 **** if(x->x_gui.x_locked) return; bng_set(x); ! if(!x->x_gui.x_put_in2out) ! {x->x_gui.x_locked = 1; clock_delay(x->x_clock_lck, 2);} outlet_bang(x->x_gui.x_obj.ob_outlet); ! if(x->x_gui.x_snd_able && x->x_gui.x_snd->s_thing && x->x_gui.x_put_in2out) ! pd_bang(x->x_gui.x_snd->s_thing); } static void bng_bang2(t_bng *x) { --- 101,107 ---- if(x->x_gui.x_locked) return; bng_set(x); ! if(!x->x_gui.x_put_in2out) {x->x_gui.x_locked = 1; clock_delay(x->x_clock_lck, 2);} outlet_bang(x->x_gui.x_obj.ob_outlet); ! if(x->x_gui.x_snd_able && x->x_gui.x_snd->s_thing && x->x_gui.x_put_in2out) pd_bang(x->x_gui.x_snd->s_thing); } static void bng_bang2(t_bng *x) { *************** *** 129,133 **** x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a); bng_check_minmax(x, ftbreak, fthold); ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, 0); canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x); } --- 120,124 ---- x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size(a); bng_check_minmax(x, ftbreak, fthold); ! x->x_gui.x_draw(x, x->x_gui.x_glist, 0); canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x); } *************** *** 144,149 **** static void bng_size(t_bng *x, t_symbol *s, int ac, t_atom *av) { ! x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); ! x->x_gui.x_h = x->x_gui.x_w; iemgui_size((t_iemgui *)x); } --- 135,139 ---- static void bng_size(t_bng *x, t_symbol *s, int ac, t_atom *av) { ! x->x_gui.x_h = x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); iemgui_size((t_iemgui *)x); } *************** *** 151,156 **** static void bng_flashtime(t_bng *x, t_symbol *s, int ac, t_atom *av) { ! bng_check_minmax(x, (int)atom_getintarg(0, ac, av), ! (int)atom_getintarg(1, ac, av)); }
--- 141,147 ---- static void bng_flashtime(t_bng *x, t_symbol *s, int ac, t_atom *av) { ! bng_check_minmax(x, ! (int)atom_getintarg(0, ac, av), ! (int)atom_getintarg(1, ac, av)); }
*************** *** 165,169 **** int bflcol[]={-262144, -1, -1}; int a=IEM_GUI_DEFAULTSIZE; ! int isa=0, fstyle=0, fs=8; int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold= IEM_BNG_DEFAULTHOLDFLASHTIME; --- 156,160 ---- int bflcol[]={-262144, -1, -1}; int a=IEM_GUI_DEFAULTSIZE; ! int isa=0, fs=8; int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold= IEM_BNG_DEFAULTHOLDFLASHTIME; *************** *** 171,177 **** pd_scanargs(argc,argv,"iiiiaaaiiiiiii", &a,&fthold,&ftbreak,&isa,&srl[0],&srl[1],&srl[2], ! &x->x_gui.x_ldx,&x->x_gui.x_ldy,&fstyle,&fs,&bflcol[0],&bflcol[1],&bflcol[2]); iem_inttosymargs(&x->x_gui,isa); - x->x_gui.x_font_style = fstyle; iemgui_new_getnames2(&x->x_gui, 4, srl[0], srl[1], srl[2]); x->x_gui.x_draw = (t_iemfunptr)bng_draw; --- 162,167 ---- pd_scanargs(argc,argv,"iiiiaaaiiiiiii", &a,&fthold,&ftbreak,&isa,&srl[0],&srl[1],&srl[2], ! &x->x_gui.x_ldx,&x->x_gui.x_ldy,&x->x_gui.x_font_style,&fs,&bflcol[0],&bflcol[1],&bflcol[2]); iem_inttosymargs(&x->x_gui,isa); iemgui_new_getnames2(&x->x_gui, 4, srl[0], srl[1], srl[2]); x->x_gui.x_draw = (t_iemfunptr)bng_draw; *************** *** 196,201 **** static void bng_free(t_bng *x) { ! if(x->x_gui.x_rcv_able) ! pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); clock_free(x->x_clock_lck); clock_free(x->x_clock_brk); --- 186,190 ---- static void bng_free(t_bng *x) { ! if(x->x_gui.x_rcv_able) pd_unbind((t_pd *)x, x->x_gui.x_rcv); clock_free(x->x_clock_lck); clock_free(x->x_clock_brk);
Index: x_gui.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/x_gui.c,v retrieving revision 1.1.1.1.16.2 retrieving revision 1.1.1.1.16.2.2.1 diff -C2 -d -r1.1.1.1.16.2 -r1.1.1.1.16.2.2.1 *** x_gui.c 2 Aug 2003 15:37:49 -0000 1.1.1.1.16.2 --- x_gui.c 3 May 2004 05:37:15 -0000 1.1.1.1.16.2.2.1 *************** *** 43,47 **** messages; e.g., "pdtk_canvas_dofont %s 10". */
! void gfxstub_new(t_pd *owner, void *key, const char *cmd) { char buf[MAXPDSTRING]; --- 43,47 ---- messages; e.g., "pdtk_canvas_dofont %s 10". */
! t_symbol *gfxstub_new(t_pd *owner, void *key, const char *cmd) { char buf[MAXPDSTRING]; *************** *** 53,64 **** if (x->x_key == key) gfxstub_deleteforkey(key); ! if (strlen(cmd) + 50 > MAXPDSTRING) ! { ! bug("audio dialog too long"); ! return; } x = (t_gfxstub *)pd_new(gfxstub_class); sprintf(namebuf, ".gfxstub%x", (int)x); /* GG int != t_int */ - s = gensym(namebuf); pd_bind(&x->x_pd, s); --- 53,64 ---- if (x->x_key == key) gfxstub_deleteforkey(key); ! if (cmd) { ! if (snprintf(buf, sizeof(buf), cmd, s->s_name) >= sizeof buf) { ! bug("audio dialog too long"); ! return 0; ! } } x = (t_gfxstub *)pd_new(gfxstub_class); sprintf(namebuf, ".gfxstub%x", (int)x); /* GG int != t_int */ s = gensym(namebuf); pd_bind(&x->x_pd, s); *************** *** 68,73 **** x->x_next = gfxstub_list; gfxstub_list = x; ! sprintf(buf, cmd, s->s_name); ! sys_gui(buf); }
--- 68,73 ---- x->x_next = gfxstub_list; gfxstub_list = x; ! if (cmd) sys_gui(buf); ! return x->x_sym; }