aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.common66
-rwxr-xr-xquoteinitializer2
-rw-r--r--shared/common/port.c12
-rw-r--r--shared/toxy/scriptlet.c2
-rw-r--r--test/toxy/default.wid26
-rw-r--r--test/toxy/stress/bulk.pd78
-rw-r--r--test/toxy/stress/catchme.pd117
-rw-r--r--test/toxy/tclversion.pd13
-rw-r--r--toxy/build_counter2
-rw-r--r--toxy/widget.c2
10 files changed, 275 insertions, 45 deletions
diff --git a/Makefile.common b/Makefile.common
index 46bdc38..eaeaadd 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -42,6 +42,8 @@ SHARED_DIR = $(ROOT_DIR)/shared
OBJ_DIR = .
OUT_DIR = $(ROOT_DIR)/bin
+# for current versions, $(BASE_DIR) equals $(BASE_NAME), for prior versions,
+# $(BASE_DIR) equals $(BASE_NAME)-$(VERSION)
BASE_DIR = $(shell basename `pwd`)
BASE_NAME = $(shell basename `pwd` | awk -F - '{print $$1}')
@@ -55,8 +57,8 @@ AX_NAMES = $(notdir $(AX_SOURCES))
TYPES_NAMES = $(notdir $($1_SOURCES))
ifdef LX_SOURCES
-LX_NAMES = $(notdir $(LX_SOURCES))
-LX_CLASSES = $(subst _,.,$(LX_NAMES))
+LX_NAMES = $(subst _,.,$(notdir $(LX_SOURCES)))
+LX_CLASSES = $(LX_NAMES:.c=)
endif
CX_DIR = $(dir $(firstword $(CX_SOURCES)))
@@ -79,9 +81,10 @@ CFLAGS = $(WARN_CFLAGS) $(OPT_CFLAGS) $(DEFINES) $(INCLUDES)
EXTERNS = $(foreach fn,$(CX_NAMES:.c=.$(X_SUFFIX)),$(OUT_DIR)/$(fn)) \
$(foreach fn,$(AX_NAMES:.c=~.$(X_SUFFIX)),$(OUT_DIR)/$(fn)) \
- $(foreach fn,$(LX_CLASSES:.c=.$(X_SUFFIX)),$(OUT_DIR)/$(fn)) \
$(foreach fn,$(CX_CLASSES:=.$(X_SUFFIX)),$(OUT_DIR)/$(fn)) \
$(foreach fn,$(AX_CLASSES:=~.$(X_SUFFIX)),$(OUT_DIR)/$(fn)) \
+ $(foreach fn,$(LX_CLASSES:=.$(X_SUFFIX)),$(OUT_DIR)/$(fn)) \
+ $(if $(LX_STUBCLASS),$(OUT_DIR)/$(LX_STUBCLASS:=.$(X_SUFFIX))) \
$(foreach type,$(TYPES),\
$(foreach fn,$(call TYPES_EXTERNS,$(type)),$(OUT_DIR)/$(fn)))
@@ -118,6 +121,7 @@ $(if $(word 23,$(TYPES)),$(call TYPES_RULE,$(word 23,$(TYPES))))
$(if $(word 24,$(TYPES)),$(call TYPES_RULE,$(word 24,$(TYPES))))
SHOBJECTS = $(foreach fn,$(SHARED_OBJECTS),$(SHARED_DIR)/$(fn))
+LXSHOBJECTS = $(foreach fn,$(LXSHARED_OBJECTS),$(SHARED_DIR)/$(fn))
OBJECTS = $(foreach fn,$(OTHER_SOURCES:.c=.o),$(OBJ_DIR)/$(fn)) \
$(foreach fn,$(LX_SOURCES:.c=.o),$(OBJ_DIR)/$(fn)) \
@@ -126,39 +130,33 @@ OBJECTS = $(foreach fn,$(OTHER_SOURCES:.c=.o),$(OBJ_DIR)/$(fn)) \
# lame...
.PRECIOUS: %.o
+# library stub equals $(BASE_NAME) by default, otherwise
+# it has to be declared explicitly in $(BASE_DIR)/Makefile.sources
+ifdef LX_STUBCLASS
+$(OUT_DIR)/$(LX_STUBCLASS).$(X_SUFFIX): $(BASE_NAME)_loader.c $(LXSHOBJECTS)
+ $(CC) -o $@ -Xlinker -defsym \
+ -Xlinker $(LX_STUBCLASS)_setup=$(BASE_NAME)_loader_setup \
+ $(CFLAGS) $(LFLAGS) $(LXSHOBJECTS) $<
+ifndef LX_STUB
+LX_STUB = $(LX_STUBCLASS)
+endif
+else
+ifndef LX_STUB
+LX_STUB = $(BASE_NAME)
+endif
+endif
+
# rules for aliases must precede generic extern rules
-# FIXME
-$(OUT_DIR)/$(BASE_NAME).%~.$(X_SUFFIX): $(BASE_NAME)_loader.c $(SHOBJECTS)
+$(OUT_DIR)/$(LX_STUB).%~.$(X_SUFFIX): $(BASE_NAME)_loader.c $(LXSHOBJECTS)
$(CC) -o $@ -Xlinker -defsym \
- -Xlinker $(BASE_NAME).$(*F)_tilde_setup=$(BASE_NAME)_loader_setup \
- $(CFLAGS) $(LFLAGS) $(SHOBJECTS) $<
+ -Xlinker $(LX_STUB).$(*F)_tilde_setup=$(BASE_NAME)_loader_setup \
+ $(CFLAGS) $(LFLAGS) $(LXSHOBJECTS) $<
-$(OUT_DIR)/$(BASE_NAME).%.$(X_SUFFIX): $(BASE_NAME)_loader.c $(SHOBJECTS)
+$(OUT_DIR)/$(LX_STUB).%.$(X_SUFFIX): $(BASE_NAME)_loader.c $(LXSHOBJECTS)
$(CC) -o $@ -Xlinker -defsym \
- -Xlinker $(BASE_NAME).$(*F)_setup=$(BASE_NAME)_loader_setup \
- $(CFLAGS) $(LFLAGS) $(SHOBJECTS) $<
-
-#$(OUT_DIR)/$(BASE_NAME).%.$(X_SUFFIX): $(BASE_NAME)_%.c $(SHOBJECTS)
-# $(CC) -c $(CFLAGS) $<
-# -ld -o $@ -defsym $(BASE_NAME).$(*F)_setup=$(BASE_NAME)_$(*F)_setup \
-# -L $(OUT_DIR) $(LFLAGS) $(SHOBJECTS) \
-# $(BASE_NAME).$(X_SUFFIX) $(BASE_NAME)_$(*F).o
-
-# $(CC) -o $@ -Xlinker -defsym \
-# -Xlinker $(BASE_NAME).$(*F)_setup=$(BASE_NAME)_$(*F)_setup \
-# -Xlinker -rpath -Xlinker $(OUT_DIR) \
-# $(CFLAGS) $(LFLAGS) $(SHOBJECTS) $(BASE_NAME).$(X_SUFFIX) $<
-
-# library stub
-# if not equal BASE_NAME, it has to be declared explicitly in BASE_DIR/Makefile
-# FIXME
-$(OUT_DIR)/$(LX_STUB)_%~.$(X_SUFFIX): $(OUT_DIR)/$(BASE_NAME).$(X_SUFFIX)
- -ln -sf $(BASE_NAME).$(X_SUFFIX) $@
-$(OUT_DIR)/$(LX_STUB)_%.$(X_SUFFIX): $(OUT_DIR)/$(BASE_NAME).$(X_SUFFIX)
- -ln -sf $(BASE_NAME).$(X_SUFFIX) $@
-$(OUT_DIR)/$(LX_STUB).$(X_SUFFIX): $(OUT_DIR)/$(BASE_NAME).$(X_SUFFIX)
- -ln -sf $(BASE_NAME).$(X_SUFFIX) $@
+ -Xlinker $(LX_STUB).$(*F)_setup=$(BASE_NAME)_loader_setup \
+ $(CFLAGS) $(LFLAGS) $(LXSHOBJECTS) $<
# generic rule for audio externals
$(OUT_DIR)/%~.$(X_SUFFIX): $(AX_DIR)%.c $(OBJECTS)
@@ -241,11 +239,15 @@ REL_LIBNAMES = $(foreach fn,$(RELEASE_LIBS:=.$(X_SUFFIX)),$(REL_BINDIR)/$(fn))
REL_EXTERNS = $(foreach fn,$(CX_NAMES:.c=.$(X_SUFFIX)),$(REL_BINDIR)/$(fn)) \
$(foreach fn,$(AX_NAMES:.c=~.$(X_SUFFIX)),$(REL_BINDIR)/$(fn)) \
+ $(foreach fn,$(CX_CLASSES:=.$(X_SUFFIX)),$(REL_BINDIR)/$(fn)) \
+ $(foreach fn,$(AX_CLASSES:=~.$(X_SUFFIX)),$(REL_BINDIR)/$(fn)) \
+ $(foreach fn,$(LX_CLASSES:=.$(X_SUFFIX)),$(REL_BINDIR)/$(fn)) \
+ $(if $(LX_STUBCLASS),$(REL_BINDIR)/$(LX_STUBCLASS:=.$(X_SUFFIX))) \
$(REL_LIBNAMES) $(foreach fn,$(RELEASE_APPS),$(REL_BINDIR)/$(fn)) \
$(foreach type,$(TYPES),\
$(foreach fn,$(call TYPES_EXTERNS,$(type)),$(REL_BINDIR)/$(fn)))
-REL_ROOTSRC = LICENSE.txt Makefile.common dumpsetups
+REL_ROOTSRC = LICENSE.txt Makefile.common dumpsetups quoteinitializer
srelease: emptydeps define_build
cd $(ROOT_DIR)/shared; $(MAKE) emptydeps
diff --git a/quoteinitializer b/quoteinitializer
index 495eefe..6d4716d 100755
--- a/quoteinitializer
+++ b/quoteinitializer
@@ -1,4 +1,4 @@
-#!/usr/bin/awk -f
+#!/usr/bin/gawk -f
BEGIN\
{
diff --git a/shared/common/port.c b/shared/common/port.c
index 556af8f..fa81bc0 100644
--- a/shared/common/port.c
+++ b/shared/common/port.c
@@ -162,20 +162,22 @@ static int import_obj(t_port *x, char *name)
static int import_objarg(t_port *x, char *name)
{
int ndx = (x->x_inmess[1].a_w.w_symbol == gensym("user") ? 3 : 2);
- if (x->x_inatoms > 6)
+ if (x->x_inatoms > 6
+ || (ndx == 3 && x->x_inatoms > 4))
{
- t_atom *in = x->x_inmess + 7;
- t_atom *out = x->x_outmess;
+ int nextra;
+ t_atom *in, *out = x->x_outmess;
SETSYMBOL(out, gensym("#X")); out++;
SETSYMBOL(out, gensym("obj")); out++;
port_setxy(x, ndx, out);
binbuf_add(x->x_newbb, 4, x->x_outmess);
import_addclassname(x, name, &x->x_inmess[ndx == 2 ? 6 : 2]);
out = x->x_outmess;
- for (ndx = 7; ndx < x->x_inatoms; ndx++)
+ for (ndx = 7, nextra = 1, in = x->x_inmess + 7;
+ ndx < x->x_inatoms; ndx++, nextra++)
*out++ = *in++;
SETSEMI(out);
- binbuf_add(x->x_newbb, x->x_inatoms - 6, x->x_outmess);
+ binbuf_add(x->x_newbb, nextra, x->x_outmess);
x->x_nobj++;
return (PORT_NEXT);
}
diff --git a/shared/toxy/scriptlet.c b/shared/toxy/scriptlet.c
index 635c106..9bc312d 100644
--- a/shared/toxy/scriptlet.c
+++ b/shared/toxy/scriptlet.c
@@ -197,7 +197,7 @@ static char *scriptlet_dedot(t_scriptlet *sp, char *ibuf, char *obuf,
if (resolveall)
{
t_canvas *cv;
- if (cv = scriptlet_canvasvalidate(sp, visedonly))
+ if (cv = scriptlet_canvasvalidate(sp, 0))
{
if (!strncmp(&ibuf[1], "tag", 3))
{
diff --git a/test/toxy/default.wid b/test/toxy/default.wid
index f3f549f..5553c92 100644
--- a/test/toxy/default.wid
+++ b/test/toxy/default.wid
@@ -29,10 +29,18 @@ proc ::toxy::itemsettrace {op path target varname} {
error $err
}
} else {
- trace add variable $res write "::toxy::itembindtrace $varname"
+ if {[info tclversion] < 8.4} {
+ trace variable $res w "::toxy::itembindtrace $varname"
+ } else {
+ trace add variable $res write "::toxy::itembindtrace $varname"
+ }
}
if {![info exists $varname.last]} { set $varname.last "" }
- trace add variable $varname write "::toxy::itemdotrace $target"
+ if {[info tclversion] < 8.4} {
+ trace variable $varname w "::toxy::itemdotrace $target"
+ } else {
+ trace add variable $varname write "::toxy::itemdotrace $target"
+ }
return
} else { return 0 }
}
@@ -45,8 +53,12 @@ proc ::toxy::itemremovetrace {op path varname} {
error $err
}
} elseif {$res != ""} {
- catch { trace remove variable \
- $res write "::toxy::itembindtrace $varname" }
+ if {[info tclversion] < 8.4} {
+ catch { trace vdelete $res w "::toxy::itembindtrace $varname" }
+ } else {
+ catch { trace remove variable \
+ $res write "::toxy::itembindtrace $varname" }
+ }
}
}
}
@@ -54,7 +66,11 @@ proc ::toxy::itemremovetrace {op path varname} {
proc ::toxy::itemdestroy {path varname} {
::toxy::itemremovetrace -variable $path $varname.var
::toxy::itemremovetrace -textvariable $path $varname.txt
- unset -nocomplain $varname.last $varname.var $varname.txt $varname
+ if {[info tclversion] < 8.4} {
+ catch { unset $varname.last $varname.var $varname.txt $varname }
+ } else {
+ unset -nocomplain $varname.last $varname.var $varname.txt $varname
+ }
catch {destroy $path}
}
diff --git a/test/toxy/stress/bulk.pd b/test/toxy/stress/bulk.pd
new file mode 100644
index 0000000..e4efc49
--- /dev/null
+++ b/test/toxy/stress/bulk.pd
@@ -0,0 +1,78 @@
+#N canvas 75 60 628 612 12;
+#X obj 62 449 pack;
+#X obj 62 387 t b b;
+#X obj 62 356 until;
+#X obj 33 250 makefilename #%x;
+#X obj 33 219 + 256;
+#X obj 33 188 random 3840;
+#X obj 62 418 random 500;
+#X obj 175 418 random 500;
+#X obj 33 126 + 3;
+#X obj 83 6 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1;
+#X obj 157 95 random 10;
+#X obj 157 126 sel 7;
+#X obj 175 449 + 20;
+#X obj 33 6 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1
+;
+#X msg 130 33 tot .^.c delete bulk;
+#X msg 62 480 add [expr \$1 + .#1] [expr \$2 + .#2];
+#X msg 62 511 debug;
+#X obj 33 285 pack s 0 0;
+#X msg 33 320 add -tags bulk -fill \$1 -smooth true \, push \$2 \$3
+;
+#X msg 157 188 reset \, add .^.c create polygon;
+#X obj 261 250 random 150;
+#X obj 201 219 random 100;
+#X obj 201 250 + 10;
+#X obj 33 95 random 700;
+#X obj 33 544 tot .;
+#X obj 328 414 makefilename #%x;
+#X obj 328 383 + 256;
+#X obj 328 352 random 3840;
+#X msg 328 449 tot .^.c configure -bg \$1;
+#X obj 33 157 t b b b 0 b;
+#X obj 33 64 t b b b;
+#X obj 277 95 random 5;
+#X obj 277 126 sel 3;
+#X obj 33 33 metro 300;
+#X connect 0 0 15 0;
+#X connect 1 0 6 0;
+#X connect 1 1 7 0;
+#X connect 2 0 1 0;
+#X connect 3 0 17 0;
+#X connect 4 0 3 0;
+#X connect 5 0 4 0;
+#X connect 6 0 0 0;
+#X connect 7 0 12 0;
+#X connect 8 0 29 0;
+#X connect 9 0 33 0;
+#X connect 10 0 11 0;
+#X connect 11 0 14 0;
+#X connect 12 0 0 1;
+#X connect 13 0 30 0;
+#X connect 14 0 24 0;
+#X connect 15 0 24 0;
+#X connect 16 0 24 0;
+#X connect 17 0 18 0;
+#X connect 18 0 24 0;
+#X connect 19 0 24 0;
+#X connect 20 0 17 2;
+#X connect 21 0 22 0;
+#X connect 22 0 17 1;
+#X connect 23 0 8 0;
+#X connect 24 3 27 0;
+#X connect 25 0 28 0;
+#X connect 26 0 25 0;
+#X connect 27 0 26 0;
+#X connect 28 0 24 0;
+#X connect 29 0 5 0;
+#X connect 29 1 21 0;
+#X connect 29 2 20 0;
+#X connect 29 3 2 0;
+#X connect 29 4 19 0;
+#X connect 30 0 23 0;
+#X connect 30 1 10 0;
+#X connect 30 2 31 0;
+#X connect 31 0 32 0;
+#X connect 32 0 27 0;
+#X connect 33 0 30 0;
diff --git a/test/toxy/stress/catchme.pd b/test/toxy/stress/catchme.pd
new file mode 100644
index 0000000..318cf70
--- /dev/null
+++ b/test/toxy/stress/catchme.pd
@@ -0,0 +1,117 @@
+#N canvas 68 66 301 201 12;
+#N canvas 106 79 583 484 catchme 0;
+#X obj 150 96 t b b;
+#X obj 150 207 + 100;
+#X obj 251 207 + 100;
+#X obj 150 133 random 10;
+#X obj 251 133 random 10;
+#X obj 22 22 inlet;
+#X msg 22 290 tot wm geometry .^ \$1;
+#X obj 150 60 metro 30;
+#X obj 349 60 metro 3000;
+#X obj 349 96 random 300;
+#X obj 452 96 random 300;
+#X obj 190 170 line;
+#X obj 291 170 line;
+#X obj 22 60 metro 1000;
+#X obj 22 253 sprintf symbol %dx%d+%d+%d;
+#X obj 22 170 line;
+#X obj 89 207 + 200;
+#X msg 22 133 \$1 900;
+#X msg 452 133 \$1 2900;
+#X msg 349 133 \$1 2900;
+#X obj 22 96 random 75;
+#X obj 22 207 + 300;
+#X obj 490 60 metro 300;
+#X obj 22 325 tot catchme.pd;
+#X obj 143 363 delay 500;
+#X obj 143 443 s catchme-start;
+#X obj 260 325 key;
+#X obj 260 363 sel 32;
+#X msg 191 401 0;
+#X msg 143 401 1;
+#N canvas 90 49 662 516 selfornamentation 0;
+#X obj 38 85 random 256;
+#X obj 135 85 random 256;
+#X obj 233 85 random 256;
+#X obj 113 407 symbol;
+#X obj 113 290 random 3;
+#X obj 113 322 sel 0 1 2;
+#X obj 38 120 sprintf symbol #%02x%02x%02x;
+#X msg 193 363 scraTchme;
+#X msg 113 363 caTchme;
+#X msg 297 363 deTachme;
+#X obj 38 14 inlet;
+#X msg 38 159 tot .~root.c itemconfig .~tagR -fill \$1;
+#X msg 66 206 tot .~root.c itemconfig .~tagR -width 11;
+#X msg 86 244 tot .~root.c itemconfig .~tag -font .(helvetica 48 bold
+italic.);
+#X obj 38 48 t b b b b;
+#X obj 169 14 inlet;
+#X obj 38 476 tot catchme;
+#X msg 113 443 tot .~owner.c itemconfig .~tag -text \$1;
+#X connect 0 0 6 0;
+#X connect 1 0 6 1;
+#X connect 2 0 6 2;
+#X connect 3 0 17 0;
+#X connect 4 0 5 0;
+#X connect 5 0 8 0;
+#X connect 5 1 7 0;
+#X connect 5 2 9 0;
+#X connect 6 0 11 0;
+#X connect 7 0 3 0;
+#X connect 8 0 3 0;
+#X connect 9 0 3 0;
+#X connect 10 0 14 0;
+#X connect 11 0 16 0;
+#X connect 12 0 16 0;
+#X connect 13 0 16 0;
+#X connect 14 0 0 0;
+#X connect 14 1 1 0;
+#X connect 14 2 2 0;
+#X connect 14 3 4 0;
+#X connect 15 0 12 0;
+#X connect 15 0 13 0;
+#X connect 17 0 16 0;
+#X restore 319 253 pd selfornamentation;
+#X connect 0 0 3 0;
+#X connect 0 1 4 0;
+#X connect 1 0 14 2;
+#X connect 2 0 14 3;
+#X connect 3 0 1 0;
+#X connect 4 0 2 0;
+#X connect 5 0 7 0;
+#X connect 5 0 8 0;
+#X connect 5 0 13 0;
+#X connect 5 0 22 0;
+#X connect 6 0 23 0;
+#X connect 7 0 0 0;
+#X connect 8 0 9 0;
+#X connect 8 0 10 0;
+#X connect 9 0 19 0;
+#X connect 10 0 18 0;
+#X connect 11 0 1 1;
+#X connect 12 0 2 1;
+#X connect 13 0 20 0;
+#X connect 14 0 6 0;
+#X connect 15 0 16 0;
+#X connect 15 0 21 0;
+#X connect 16 0 14 1;
+#X connect 17 0 15 0;
+#X connect 18 0 12 0;
+#X connect 19 0 11 0;
+#X connect 20 0 17 0;
+#X connect 21 0 14 0;
+#X connect 22 0 30 0;
+#X connect 23 3 24 0;
+#X connect 23 3 30 1;
+#X connect 24 0 29 0;
+#X connect 26 0 27 0;
+#X connect 27 0 28 0;
+#X connect 28 0 25 0;
+#X connect 29 0 25 0;
+#X coords 0 0 0.00362319 0.00319489 200 140 0;
+#X restore 15 80 pd catchme;
+#X obj 15 29 tgl 10 0 empty catchme-start empty 0 -6 0 8 -262144 -1
+-1 0 1;
+#X connect 1 0 0 0;
diff --git a/test/toxy/tclversion.pd b/test/toxy/tclversion.pd
new file mode 100644
index 0000000..9b348b0
--- /dev/null
+++ b/test/toxy/tclversion.pd
@@ -0,0 +1,13 @@
+#N canvas 68 131 532 301 24;
+#X obj 38 191 tot .;
+#X obj 38 29 loadbang;
+#X msg 38 138 query concat set [info tclversion];
+#X msg 38 243;
+#X obj 38 86 t b b;
+#X msg 147 191 set;
+#X connect 0 0 3 0;
+#X connect 1 0 4 0;
+#X connect 2 0 0 0;
+#X connect 4 0 2 0;
+#X connect 4 1 5 0;
+#X connect 5 0 3 0;
diff --git a/toxy/build_counter b/toxy/build_counter
index a4b640c..769329b 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 2
+#define TOXY_BUILD 3
diff --git a/toxy/widget.c b/toxy/widget.c
index a7a983a..7fdd90c 100644
--- a/toxy/widget.c
+++ b/toxy/widget.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 crash if closing window with a failed widget (e.g. .wid missing) */
+
/* LATER think about reloading method for .wid files */
#include <stdio.h>