diff --git a/externals/pddp/pddplink-help.pd b/externals/pddp/pddplink-help.pd index dd7ecad67936695f0240bb9312d81527d045f49a..0553a222d2bf0e9b3ff64d801e0eec5f78ce3d02 100644 --- a/externals/pddp/pddplink-help.pd +++ b/externals/pddp/pddplink-help.pd @@ -1,4 +1,4 @@ -#N canvas 319 94 424 397 12; +#N canvas 319 94 424 539 12; #X text 20 10 first entry; #X text 50 50 three ways of linking to a; #X text 50 170 three ways of linking to a; @@ -21,6 +21,16 @@ #X obj 50 99 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 71 96 <-- bang to open the link; +#X text 50 410 purr-data only: pass the file name or URL as a symbol +to inlet #1 (a dummy filename argument is still needed), f 47; +#X msg 50 470 symbol http://puredata.info; +#X obj 250 450 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 250 470 symbol README.txt; +#X obj 50 499 pddplink dummy -box; #X connect 13 0 8 0; #X connect 15 0 4 0; #X connect 17 0 12 0; +#X connect 20 0 23 0; +#X connect 21 0 22 0; +#X connect 22 0 23 0; diff --git a/externals/pddp/pddplink.c b/externals/pddp/pddplink.c index 7120241ca2f17d3710202265d3815e1208916542..983ab0c6e3676dc0d5a4cb8c8f24883fa8c88b1e 100644 --- a/externals/pddp/pddplink.c +++ b/externals/pddp/pddplink.c @@ -221,13 +221,22 @@ static t_pd *pddplink_pdtarget(t_pddplink *x) return ((t_pd *)x); /* internal error */ } -static void pddplink_anything(t_pddplink *x, t_symbol *s, int ac, t_atom *av) +static void pddplink_symbol(t_pddplink *x, t_symbol *s) { if (x->x_ishit) { - startpost("pddplink: internal error (%s", (s ? s->s_name : "")); - postatom(ac, av); - post(")"); + post("pddplink: internal error (%s)", (s ? s->s_name : "")); + } + else + { + if (s == &s_) return; // nothing to see here, move along... + x->x_ishit = 1; + char final_name[FILENAME_MAX]; + sys_expandpathelems(s->s_name, final_name); + gui_vmess("gui_pddplink_open", "ss", + final_name, + x->x_dirsym->s_name); + x->x_ishit = 0; } } @@ -400,9 +409,7 @@ static void *pddplink_new(t_symbol *s, int ac, t_atom *av) SETSYMBOL(&x->x_openargs[0], x->x_ulink); SETSYMBOL(&x->x_openargs[1], x->x_dirsym); x->x_ishit = 0; - if (x->x_isboxed) - outlet_new((t_object *)x, &s_anything); - else + if (!x->x_isboxed) { /* do we need to set ((t_text *)x)->te_type = T_TEXT; ? */ if (!x->x_vistext) @@ -426,14 +433,14 @@ void pddplink_setup(void) sizeof(t_pddplink), CLASS_NOINLET | CLASS_PATCHABLE, A_GIMME, 0); - class_addanything(pddplink_class, pddplink_anything); + class_addsymbol(pddplink_class, pddplink_symbol); class_setwidget(pddplink_class, &pddplink_widgetbehavior); pddplinkbox_class = class_new(gensym("pddplink"), 0, (t_method)pddplink_free, sizeof(t_pddplink), 0, A_GIMME, 0); class_addbang(pddplinkbox_class, pddplink_bang); - class_addanything(pddplinkbox_class, pddplink_anything); + class_addsymbol(pddplinkbox_class, pddplink_symbol); class_addmethod(pddplinkbox_class, (t_method)pddplink_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);