diff options
author | N.N. <krzyszcz@users.sourceforge.net> | 2004-03-10 10:55:57 +0000 |
---|---|---|
committer | N.N. <krzyszcz@users.sourceforge.net> | 2004-03-10 10:55:57 +0000 |
commit | c7389b6452e3d44d8f8fb9699f06c1b2db1c51ba (patch) | |
tree | 0a838b12169ae88f070df5a9c89f636507e4eb47 | |
parent | bc5e203f7787980f65f81ddbf69a619ab34fa85e (diff) |
toxy alpha7
svn path=/trunk/externals/miXed/; revision=1402
-rw-r--r-- | shared/toxy/scriptlet.c | 12 | ||||
-rw-r--r-- | shared/toxy/scriptlet.h | 8 | ||||
-rw-r--r-- | test/toxy/multiscale-test.pd | 66 | ||||
-rw-r--r-- | test/toxy/multiscale.wid | 14 | ||||
-rw-r--r-- | test/toxy/stress/pophurd.pd | 68 | ||||
-rw-r--r-- | toxy/Makefile | 12 | ||||
-rw-r--r-- | toxy/build_counter | 2 | ||||
-rw-r--r-- | toxy/widget.c | 24 | ||||
-rw-r--r-- | toxy/widgettype.c | 2 |
9 files changed, 159 insertions, 49 deletions
diff --git a/shared/toxy/scriptlet.c b/shared/toxy/scriptlet.c index 4f4221f..b21f51a 100644 --- a/shared/toxy/scriptlet.c +++ b/shared/toxy/scriptlet.c @@ -342,9 +342,9 @@ void scriptlet_prealloc(t_scriptlet *sp, int sz, int mayshrink) scriptlet_reset(sp); } -int scriptlet_addstring(t_scriptlet *sp, char *ibuf, - int resolveall, int visedonly, - int ac, t_atom *av, t_props *argprops) +static int scriptlet_addstring(t_scriptlet *sp, char *ibuf, + int resolveall, int visedonly, + int ac, t_atom *av, t_props *argprops) { int result = 1; char *bp = ibuf, *ep = ibuf, *ep1; @@ -373,7 +373,7 @@ int scriptlet_addstring(t_scriptlet *sp, char *ibuf, return (result); } -int scriptlet_addfloat(t_scriptlet *sp, t_float f) +static int scriptlet_addfloat(t_scriptlet *sp, t_float f) { char buf[64]; if (!sp->s_separator) @@ -450,8 +450,8 @@ void scriptlet_vpush(t_scriptlet *sp, char *varname) } } -int scriptlet_evaluate(t_scriptlet *insp, t_scriptlet *outsp, - int visedonly, int ac, t_atom *av, t_props *argprops) +int scriptlet_evaluate(t_scriptlet *insp, t_scriptlet *outsp, int visedonly, + int ac, t_atom *av, t_props *argprops) { if (scriptlet_ready(insp)) { diff --git a/shared/toxy/scriptlet.h b/shared/toxy/scriptlet.h index b284797..30b8df9 100644 --- a/shared/toxy/scriptlet.h +++ b/shared/toxy/scriptlet.h @@ -21,16 +21,12 @@ void scriptlet_reset(t_scriptlet *sp); void scriptlet_prealloc(t_scriptlet *sp, int sz, int mayshrink); int scriptlet_add(t_scriptlet *sp, int resolveall, int visedonly, int ac, t_atom *av); -int scriptlet_addstring(t_scriptlet *sp, char *ibuf, - int resolveall, int visedonly, - int ac, t_atom *av, t_props *argprops); -int scriptlet_addfloat(t_scriptlet *sp, t_float f); void scriptlet_setseparator(t_scriptlet *sp, char c); void scriptlet_push(t_scriptlet *sp); void scriptlet_qpush(t_scriptlet *sp); void scriptlet_vpush(t_scriptlet *sp, char *varname); -int scriptlet_evaluate(t_scriptlet *insp, t_scriptlet *outsp, - int visedonly, int ac, t_atom *av, t_props *argprops); +int scriptlet_evaluate(t_scriptlet *insp, t_scriptlet *outsp, int visedonly, + int ac, t_atom *av, t_props *argprops); char *scriptlet_nextword(char *buf); int scriptlet_rcparse(t_scriptlet *sp, t_pd *caller, char *rc, char *contents, t_scriptlet_cmntfn cmntfn); diff --git a/test/toxy/multiscale-test.pd b/test/toxy/multiscale-test.pd index c0383a6..cde36a8 100644 --- a/test/toxy/multiscale-test.pd +++ b/test/toxy/multiscale-test.pd @@ -1,20 +1,54 @@ -#N canvas 39 49 775 469 12; -#X obj 27 98 widget multiscale m1 #n 30 #dx 15 #dy 60; -#X obj 27 200 widget multiscale m2 #bg red #dy 120; -#X obj 188 371 tow . multiscale m1; -#X msg 27 59 #n \$1; -#X floatatom 27 24 5 0 0 0 - - -; +#N canvas 39 49 800 548 12; +#X obj 25 84 widget multiscale m1 #n 50 #dx 15 #dy 90; +#X obj 25 260 widget multiscale m2 #bg red #dy 120; +#X msg 25 52 #n \$1; +#X floatatom 25 23 5 0 0 0 - - -; #N canvas 0 0 450 300 graph1 0; #X array t 50 float 0; #X coords 0 1 49 0 400 140 1; #X restore 296 206 graph; -#X obj 188 410 tabwrite t; -#X obj 27 367 unpack; -#X floatatom 27 411 5 0 0 0 - - -; -#X floatatom 100 411 5 0 0 0 - - -; -#X connect 1 0 7 0; -#X connect 2 0 6 0; -#X connect 3 0 0 0; -#X connect 4 0 3 0; -#X connect 7 0 8 0; -#X connect 7 1 9 0; +#X obj 265 509 tabwrite t; +#X obj 27 408 unpack; +#X floatatom 27 445 5 0 0 0 - - -; +#X floatatom 100 445 5 0 0 0 - - -; +#X floatatom 109 196 5 0 0 0 - - -; +#X obj 589 509 tabread t; +#X obj 589 477 t 0 0; +#X obj 589 413 until; +#X obj 265 477 tow . multiscale m1; +#X obj 589 381 r rcount; +#X obj 589 445 int; +#X obj 629 445 + 1; +#X obj 527 510 pack; +#X msg 265 445 tot pd [concat rcount .#n .`.:]; +#X obj 265 408 t b b; +#X msg 653 414 0; +#X obj 127 23 widget button b -command .<.> -bg yellow -width 3 -height +2; +#X obj 265 372 tow . button b; +#X obj 25 228 pack; +#X floatatom 25 199 5 0 0 0 - - -; +#X connect 1 0 6 0; +#X connect 2 0 0 0; +#X connect 3 0 2 0; +#X connect 6 0 7 0; +#X connect 6 1 8 0; +#X connect 9 0 1 0; +#X connect 9 0 23 1; +#X connect 10 0 17 0; +#X connect 11 0 10 0; +#X connect 11 1 17 1; +#X connect 12 0 15 0; +#X connect 13 0 5 0; +#X connect 14 0 12 0; +#X connect 15 0 16 0; +#X connect 15 0 11 0; +#X connect 16 0 15 1; +#X connect 17 0 13 0; +#X connect 18 0 13 0; +#X connect 19 0 18 0; +#X connect 19 1 20 0; +#X connect 20 0 15 1; +#X connect 22 0 19 0; +#X connect 23 0 1 0; +#X connect 24 0 23 0; diff --git a/test/toxy/multiscale.wid b/test/toxy/multiscale.wid index f66ef6c..be56d2b 100644 --- a/test/toxy/multiscale.wid +++ b/test/toxy/multiscale.wid @@ -2,6 +2,18 @@ proc ::toxy::multiscalecommand {target sel ndx v} { pd [concat $target $sel $v $ndx \;] } +proc ::toxy::multiscale_float {path target count ndx} { + if {$ndx >= 0 && $ndx < $count} { + pd [concat $target _cb [$path.s$ndx get] $ndx \;] + } +} + +proc ::toxy::multiscale_list {path count ndx v} { + if {$ndx >= 0 && $ndx < $count} { + $path.s$ndx set $v + } +} + proc ::toxy::multiscale {path target remote count dx dy bg} { if {[winfo exists $path.s0]} { # puts stderr [concat $path.s0 exists] @@ -32,6 +44,8 @@ proc ::toxy::multiscale {path target remote count dx dy bg} { #> multiscale canvas #. #n 3 #dx 60 #dy 90 #. #bg yellow +#. @float ::toxy::multiscale_float .- .| .#n .#1 +#. @list ::toxy::multiscale_list .- .#n .#2 .#1 ::toxy::multiscale .- .| . .#n .#dx .#dy .#bg diff --git a/test/toxy/stress/pophurd.pd b/test/toxy/stress/pophurd.pd index 0a55222..23ab805 100644 --- a/test/toxy/stress/pophurd.pd +++ b/test/toxy/stress/pophurd.pd @@ -1,84 +1,138 @@ -#N canvas 151 100 700 416 12; +#N canvas 20 49 923 553 12; #X obj 16 47 tow . popup p; #X floatatom 16 15 5 0 0 0 - - -; #X floatatom 16 84 5 0 0 0 - - -; -#X obj 180 10 widget popup p #items [info globals]; -#X obj 260 10 widget popup p #items [info globals]; -#X obj 340 10 widget popup p #items [info globals]; -#X obj 420 10 widget popup p #items [info globals]; -#X obj 500 10 widget popup p #items [info globals]; -#X obj 580 10 widget popup p #items [info globals]; +#X obj 180 10 widget popup p #items [info globals] -width 18; +#X obj 340 10 widget popup p #items [info globals] -width 18; +#X obj 500 10 widget popup p #items [info globals] -width 18; +#X obj 660 10 widget popup p #items [info globals] -width 18; #X obj 180 40 widget popup p #items [info globals]; #X obj 260 40 widget popup p #items [info globals]; #X obj 340 40 widget popup p #items [info globals]; #X obj 420 40 widget popup p #items [info globals]; #X obj 500 40 widget popup p #items [info globals]; #X obj 580 40 widget popup p #items [info globals]; +#X obj 660 40 widget popup p #items [info globals]; +#X obj 740 40 widget popup p #items [info globals]; #X obj 180 70 widget popup p #items [info globals]; #X obj 260 70 widget popup p #items [info globals]; #X obj 340 70 widget popup p #items [info globals]; #X obj 420 70 widget popup p #items [info globals]; #X obj 500 70 widget popup p #items [info globals]; #X obj 580 70 widget popup p #items [info globals]; +#X obj 660 70 widget popup p #items [info globals]; +#X obj 740 70 widget popup p #items [info globals]; #X obj 180 100 widget popup p #items [info globals]; #X obj 260 100 widget popup p #items [info globals]; #X obj 340 100 widget popup p #items [info globals]; #X obj 420 100 widget popup p #items [info globals]; #X obj 500 100 widget popup p #items [info globals]; #X obj 580 100 widget popup p #items [info globals]; +#X obj 660 100 widget popup p #items [info globals]; +#X obj 740 100 widget popup p #items [info globals]; #X obj 180 130 widget popup p #items [info globals]; #X obj 260 130 widget popup p #items [info globals]; #X obj 340 130 widget popup p #items [info globals]; #X obj 420 130 widget popup p #items [info globals]; #X obj 500 130 widget popup p #items [info globals]; #X obj 580 130 widget popup p #items [info globals]; +#X obj 660 130 widget popup p #items [info globals]; +#X obj 740 130 widget popup p #items [info globals]; #X obj 180 160 widget popup p #items [info globals]; #X obj 260 160 widget popup p #items [info globals]; #X obj 340 160 widget popup p #items [info globals]; #X obj 420 160 widget popup p #items [info globals]; #X obj 500 160 widget popup p #items [info globals]; #X obj 580 160 widget popup p #items [info globals]; +#X obj 660 160 widget popup p #items [info globals]; +#X obj 740 160 widget popup p #items [info globals]; #X obj 180 190 widget popup p #items [info globals]; #X obj 260 190 widget popup p #items [info globals]; #X obj 340 190 widget popup p #items [info globals]; #X obj 420 190 widget popup p #items [info globals]; #X obj 500 190 widget popup p #items [info globals]; #X obj 580 190 widget popup p #items [info globals]; +#X obj 660 190 widget popup p #items [info globals]; +#X obj 740 190 widget popup p #items [info globals]; #X obj 180 220 widget popup p #items [info globals]; #X obj 260 220 widget popup p #items [info globals]; #X obj 340 220 widget popup p #items [info globals]; #X obj 420 220 widget popup p #items [info globals]; #X obj 500 220 widget popup p #items [info globals]; #X obj 580 220 widget popup p #items [info globals]; +#X obj 660 220 widget popup p #items [info globals]; +#X obj 740 220 widget popup p #items [info globals]; #X obj 180 250 widget popup p #items [info globals]; #X obj 260 250 widget popup p #items [info globals]; #X obj 340 250 widget popup p #items [info globals]; #X obj 420 250 widget popup p #items [info globals]; #X obj 500 250 widget popup p #items [info globals]; #X obj 580 250 widget popup p #items [info globals]; +#X obj 660 250 widget popup p #items [info globals]; +#X obj 740 250 widget popup p #items [info globals]; #X obj 180 280 widget popup p #items [info globals]; #X obj 260 280 widget popup p #items [info globals]; #X obj 340 280 widget popup p #items [info globals]; #X obj 420 280 widget popup p #items [info globals]; #X obj 500 280 widget popup p #items [info globals]; #X obj 580 280 widget popup p #items [info globals]; +#X obj 660 280 widget popup p #items [info globals]; +#X obj 740 280 widget popup p #items [info globals]; #X obj 180 310 widget popup p #items [info globals]; #X obj 260 310 widget popup p #items [info globals]; #X obj 340 310 widget popup p #items [info globals]; #X obj 420 310 widget popup p #items [info globals]; #X obj 500 310 widget popup p #items [info globals]; #X obj 580 310 widget popup p #items [info globals]; +#X obj 660 310 widget popup p #items [info globals]; +#X obj 740 310 widget popup p #items [info globals]; #X obj 180 340 widget popup p #items [info globals]; #X obj 260 340 widget popup p #items [info globals]; #X obj 340 340 widget popup p #items [info globals]; #X obj 420 340 widget popup p #items [info globals]; #X obj 500 340 widget popup p #items [info globals]; #X obj 580 340 widget popup p #items [info globals]; +#X obj 660 340 widget popup p #items [info globals]; +#X obj 740 340 widget popup p #items [info globals]; #X obj 180 370 widget popup p #items [info globals]; #X obj 260 370 widget popup p #items [info globals]; #X obj 340 370 widget popup p #items [info globals]; #X obj 420 370 widget popup p #items [info globals]; #X obj 500 370 widget popup p #items [info globals]; #X obj 580 370 widget popup p #items [info globals]; +#X obj 660 370 widget popup p #items [info globals]; +#X obj 740 370 widget popup p #items [info globals]; +#X obj 180 400 widget popup p #items [info globals]; +#X obj 260 400 widget popup p #items [info globals]; +#X obj 340 400 widget popup p #items [info globals]; +#X obj 420 400 widget popup p #items [info globals]; +#X obj 500 400 widget popup p #items [info globals]; +#X obj 580 400 widget popup p #items [info globals]; +#X obj 660 400 widget popup p #items [info globals]; +#X obj 740 400 widget popup p #items [info globals]; +#X obj 180 430 widget popup p #items [info globals]; +#X obj 260 430 widget popup p #items [info globals]; +#X obj 340 430 widget popup p #items [info globals]; +#X obj 420 430 widget popup p #items [info globals]; +#X obj 500 430 widget popup p #items [info globals]; +#X obj 580 430 widget popup p #items [info globals]; +#X obj 660 430 widget popup p #items [info globals]; +#X obj 740 430 widget popup p #items [info globals]; +#X obj 180 460 widget popup p #items [info globals]; +#X obj 260 460 widget popup p #items [info globals]; +#X obj 340 460 widget popup p #items [info globals]; +#X obj 420 460 widget popup p #items [info globals]; +#X obj 500 460 widget popup p #items [info globals]; +#X obj 580 460 widget popup p #items [info globals]; +#X obj 660 460 widget popup p #items [info globals]; +#X obj 740 460 widget popup p #items [info globals]; +#X obj 180 490 widget popup p #items [info globals]; +#X obj 260 490 widget popup p #items [info globals]; +#X obj 340 490 widget popup p #items [info globals]; +#X obj 420 490 widget popup p #items [info globals]; +#X obj 500 490 widget popup p #items [info globals]; +#X obj 580 490 widget popup p #items [info globals]; +#X obj 660 490 widget popup p #items [info globals]; +#X obj 740 490 widget popup p #items [info globals]; #X connect 0 0 2 0; #X connect 1 0 0 0; diff --git a/toxy/Makefile b/toxy/Makefile index a9b675c..44e8206 100644 --- a/toxy/Makefile +++ b/toxy/Makefile @@ -1,6 +1,14 @@ ROOT_DIR = .. -redefault: setup.wiq default -setup.wiq: $(ROOT_DIR)/test/toxy/setup.wid +WIQFILE = setup.wiq +redefault: checkwiq $(WIQFILE) default +checkwiq: + @if [ -f $(WIQFILE) ] && ! [ -s $(WIQFILE) ] ; then \ + echo ERROR: empty file $(WIQFILE)... removed ; \ + rm -f $(WIQFILE) ; fi +$(WIQFILE): $(ROOT_DIR)/test/toxy/$(WIQFILE:.wiq=.wid) $(ROOT_DIR)/quoteinitializer $< \ '"puts stderr [concat loading built-in widget definitions]\n"' > $@ + @if [ -f $(WIQFILE) ] && ! [ -s $(WIQFILE) ] ; then \ + echo ERROR: quoteinitializer failed... $(WIQFILE) removed ; \ + rm -f $(WIQFILE) ; fi include $(ROOT_DIR)/Makefile.common diff --git a/toxy/build_counter b/toxy/build_counter index 7f25b3b..553acb4 100644 --- a/toxy/build_counter +++ b/toxy/build_counter @@ -1,3 +1,3 @@ #define TOXY_VERSION "0.1" #define TOXY_RELEASE "alpha" -#define TOXY_BUILD 6 +#define TOXY_BUILD 7 diff --git a/toxy/widget.c b/toxy/widget.c index 9d1413a..63797df 100644 --- a/toxy/widget.c +++ b/toxy/widget.c @@ -270,7 +270,8 @@ static void widget_delete(t_gobj *z, t_glist *glist) static void widget_pushoptions(t_widget *x, int doit) { char *mypathname = widget_getmypathname(x, x->x_glist)->s_name; - if (scriptlet_evaluate(x->x_optscript, x->x_transient, 0, 0, 0, 0)) + if (scriptlet_evaluate(x->x_optscript, x->x_transient, 0, + 0, 0, x->x_arguments)) { #ifdef WIDGET_DEBUG int sz; @@ -532,8 +533,8 @@ static void widget_anything(t_widget *x, t_symbol *s, int ac, t_atom *av) { scriptlet_reset(x->x_auxscript); scriptlet_add(x->x_auxscript, 0, 0, hlen - 1, hp + 1); - if (scriptlet_evaluate(x->x_auxscript, x->x_transient, - 1, ac, av, 0)) + if (scriptlet_evaluate(x->x_auxscript, x->x_transient, 1, + ac, av, x->x_arguments)) scriptlet_push(x->x_transient); } else loud_nomethod((t_pd *)x, s); @@ -574,8 +575,8 @@ static void widget_float(t_widget *x, t_float f) SETFLOAT(&at, f); scriptlet_reset(x->x_auxscript); scriptlet_add(x->x_auxscript, 0, 0, ac - 1, av + 1); - if (scriptlet_evaluate(x->x_auxscript, - x->x_transient, 1, 1, &at, 0)) + if (scriptlet_evaluate(x->x_auxscript, x->x_transient, 1, + 1, &at, x->x_arguments)) scriptlet_push(x->x_transient); } } @@ -596,8 +597,8 @@ static void widget_symbol(t_widget *x, t_symbol *s) SETSYMBOL(&at, s); scriptlet_reset(x->x_auxscript); scriptlet_add(x->x_auxscript, 0, 0, ac - 1, av + 1); - if (scriptlet_evaluate(x->x_auxscript, - x->x_transient, 1, 1, &at, 0)) + if (scriptlet_evaluate(x->x_auxscript, x->x_transient, 1, + 1, &at, x->x_arguments)) scriptlet_push(x->x_transient); } } @@ -676,10 +677,11 @@ static void widget_tot(t_widget *x, t_symbol *s, int ac, t_atom *av) { if (ac) { - t_scriptlet *sp = x->x_transient; - scriptlet_reset(sp); - scriptlet_add(sp, 1, 1, ac, av); - scriptlet_push(sp); + scriptlet_reset(x->x_auxscript); + scriptlet_add(x->x_auxscript, 1, 1, ac, av); + if (scriptlet_evaluate(x->x_auxscript, x->x_transient, 1, + 0, 0, x->x_arguments)) + scriptlet_push(x->x_transient); } } diff --git a/toxy/widgettype.c b/toxy/widgettype.c index 4541947..f9a6f46 100644 --- a/toxy/widgettype.c +++ b/toxy/widgettype.c @@ -2,6 +2,8 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ +/* FIXME .#iprops crash */ + #include <stdio.h> #include <string.h> #include "m_pd.h" |