Commit 7c054d12 authored by Jonathan Wilkes's avatar Jonathan Wilkes

Merge remote-tracking branch 'origin/master' into pdgui-refactor

parents e66428d7 c6485c39
......@@ -354,7 +354,7 @@ The following is adapted from Pd Vanilla's original source notes. (Found
in pd/src/CHANGELOG.txt for some reason...)
Sections 2-3 below are quite old. Someone needs to check whether they even
hold true for Pd Vanilla any more.
hold true for Pd Vanilla anymore.
#### Structure definition roadmap.
......@@ -390,7 +390,7 @@ Other structures:
#### 1. Coding Style
1.0 C coding style. The source should pass most "warnings" of C compilers
(-Wall on linux, for instance; see the makefile.) Some informalities
(-Wall on Linux, for instance-- see the makefile.) Some informalities
are intentional, for instance the loose use of function prototypes (see
below) and uncast conversions from longer to shorter numerical formats.
The code doesn't respect "const" yet.
......
......@@ -81,7 +81,8 @@ deb: $(debsrc) $(addprefix debian/nwjs/, $(nwjs))
# This can be removed once Ubuntu 12.04 finally goes the way of the dodo.
# cd $(debdist) && patch -p1 < ../precise-configure.patch
# Patch the user config dir name so that purr-data can coexist with pd-l2ork.
cd $(debdist) && patch -Np1 < ../userconfig.patch
# Not needed with purr-data 2.4.5+ any more.
# cd $(debdist) && patch -Np1 < ../userconfig.patch
# Make sure to copy the Debian files which may have uncommitted changes.
# Then run debuild to create the package.
cd $(debdist) && cp -R ../debian . && debuild $(DEBUILD_FLAGS)
......
......@@ -465,7 +465,7 @@ static void image_setwidget(void)
static void image_free(t_image *x)
{
//sys_vgui("image delete img%x\n", x);
gui_vmess("gui_drawimage_free", "x", x);
gui_vmess("gui_image_free", "x", x);
if (x->x_receive)
{
pd_unbind(&x->x_obj.ob_pd,x->x_receive);
......
......@@ -305,8 +305,8 @@ static void imagebang_free(t_imagebang *x) {
sprintf(key_a, "%lx_a", (long unsigned int)x);
sprintf(key_b, "%lx_b", (long unsigned int)x);
gui_vmess("gui_drawimage_free", "s", key_a);
gui_vmess("gui_drawimage_free", "s", key_b);
gui_vmess("gui_image_free", "s", key_a);
gui_vmess("gui_image_free", "s", key_b);
if (x->receive) {
pd_unbind(&x->x_obj.ob_pd,x->receive);
}
......
......@@ -12,18 +12,16 @@ BUILDLAYOUT_DIR = $(cvs_root_dir)/packages
include $(BUILDLAYOUT_DIR)/Makefile.buildlayout
# if machine has dpkg-deb, build a Debian package
#ifeq ($(shell test -x /usr/bin/dpkg-deb && echo YES),YES)
# PACKAGE_TYPE = deb
#else
# PACKAGE_TYPE = tarbz2
#endif
ifeq ($(shell test -x /usr/bin/dpkg-deb && echo YES),YES)
PACKAGE_TYPE = deb
else
PACKAGE_TYPE = tarbz2
endif
# for command-line UNIX versions, you need to install Pd into the same
# directory as $(prefix) otherwise Pd won't be able to find extra, doc, etc.
ifeq ($(PACKAGE_TYPE),deb)
prefix = /usr
# generates the dependencies for all externals and pd itself
PACKAGE_DEPENDS := $(shell find $(DESTDIR) \( -name "*.pd_linux" -or -name pd-gui -or -wholename \*bin/pd \) -print0 | xargs -0 dpkg-shlibdeps -O | sed 's|shlibs:Depends=|, |' )
else
prefix = /usr/local
endif
......@@ -160,6 +158,9 @@ deb: debstage
cp $(packages_src)/linux_make/debian/control $(DESTDIR)/DEBIAN
cp $(packages_src)/linux_make/debian/pd-l2ork.postrm $(DESTDIR)/DEBIAN
cp $(packages_src)/linux_make/debian/pd-l2ork.postinst $(DESTDIR)/DEBIAN
# generate the dependencies for all externals and pd itself
$(eval PACKAGE_DEPENDS := $(shell find $(DESTDIR) \( -name "*.pd_linux" -or -name pd-gui -or -wholename \*bin/pd \) -print0 | xargs -0 dpkg-shlibdeps -O | sed 's|shlibs:Depends=|, |' ))
# set build architecture and version for the package
sed -i 's|^Version:.*|Version: $(DEB_PD_VERSION)|' \
$(DESTDIR)/DEBIAN/control
......@@ -279,7 +280,7 @@ test_locations:
@echo "EXAMPLESDIR $(examplesdir)"
@echo --------------------------------------------------
# @echo "PACKAGE_DEPENDS $(PACKAGE_DEPENDS)"
# @echo --------------------------------------------------
@echo --------------------------------------------------
autoconf --version
@echo --------------------------------------------------
make --version
......
......@@ -6,7 +6,7 @@ Maintainer: Ivica Ico Bukvic <ico@vt.edu>
Homepage: http://l2ork.music.vt.edu
Package: pd-l2ork
Architecture: i386
Depends: libc6, xterm | x-terminal-emulator, libasound2, libjack-jackd2-0, libbluetooth3, libgl1-mesa-glx, libgl1-mesa-dri, libglu1-mesa, libftgl2, libgmerlin0, libgmerlin-avdec1, libavifile-0.7c2, libmpeg3-1 | libmpeg3-2, libquicktime2, libv4l-0, libraw1394-11, libdc1394-22, libfftw3-3, libvorbis0a, libmp3lame0, libspeex1, libgsl0ldbl | libgsl2, python, libsmpeg0, libjpeg62, libflite1, libgsm1, libxv1, fluid-soundfont-gm, byacc
Depends: python, fluid-soundfont-gm
Provides: pd-l2ork
Installed-Size: 90624
Recommends: xdg-utils, pulseaudio-utils, tap-plugins, ladspa-foo-plugins, invada-studio-plugins-ladspa, blepvco, swh-plugins, mcp-plugins, cmt, blop, slv2-jack, omins, ubuntustudio-audio-plugins, rev-plugins, dssi-utils, vco-plugins, wah-plugins, fil-plugins, mda-lv2
......
......@@ -6,7 +6,7 @@ Maintainer: Ivica Ico Bukvic <ico@vt.edu>
Homepage: http://l2ork.music.vt.edu
Package: pd-l2ork
Architecture: i386
Depends: libc6, xterm | x-terminal-emulator, libasound2, libjack-jackd2-0, libbluetooth3, libgl1-mesa-glx, libgl1-mesa-dri, libglu1-mesa, libftgl2, libgmerlin0, libgmerlin-avdec1, libavifile-0.7c2, libmpeg3-1 | libmpeg3-2, libquicktime2, libv4l-0, libraw1394-11, libdc1394-22, libfftw3-3, libvorbis0a, libmp3lame0, libspeex1, libgsl0ldbl | libgsl2, python, libsmpeg0, libjpeg62, libflite1, libgsm1, libxv1, fluid-soundfont-gm, byacc
Depends: python, fluid-soundfont-gm
Provides: pd-l2ork
Installed-Size: 90624
Recommends: xdg-utils, pulseaudio-utils, tap-plugins, ladspa-foo-plugins, invada-studio-plugins-ladspa, blepvco, swh-plugins, mcp-plugins, cmt, blop, slv2-jack, omins, ubuntustudio-audio-plugins, rev-plugins, dssi-utils, vco-plugins, wah-plugins, fil-plugins, mda-lv2
......
......@@ -6,7 +6,7 @@ Maintainer: Ivica Ico Bukvic <ico@vt.edu>
Homepage: http://l2ork.music.vt.edu
Package: pd-l2ork
Architecture: i386
Depends: xterm | x-terminal-emulator, libasound2, libjack-jackd2-0, libbluetooth3, libgl1-mesa-glx, libglu1-mesa, libftgl2, libgmerlin0, libgmerlin-avdec1, libavifile-0.7c2, libmpeg3-1 | libmpeg3-2, libquicktime2, libv4l-0, libraw1394-11, libdc1394-22, libfftw3-3, libvorbis0a, libmp3lame0, libspeex1, libgsl0ldbl, python, libsmpeg0, libjpeg62, tkpng, libflite1, libgsm1, libxv1, fluid-soundfont-gm, byacc
Depends: python, fluid-soundfont-gm
Provides: pd-l2ork
Installed-Size: 90624
Recommends: xdg-utils, pulseaudio-utils, tap-plugins, ladspa-foo-plugins, invada-studio-plugins-ladspa, blepvco, swh-plugins, mcp-plugins, cmt, blop, slv2-jack, omins, ubuntustudio-audio-plugins, rev-plugins, dssi-utils, vco-plugins, wah-plugins, fil-plugins, mda-lv2
......
......@@ -6,7 +6,7 @@ Maintainer: Ivica Ico Bukvic <ico@vt.edu>
Homepage: http://l2ork.music.vt.edu
Package: pd-l2ork
Architecture: i386
Depends: xterm | x-terminal-emulator, libc6 (>= 2.1.5), libasound2, libjack-jackd2-0, libbluetooth3, libgl1-mesa-glx, libgl1-mesa-dri, libglu1-mesa, libglew1.5, libmagick++4, libftgl2, libgmerlin0, libgmerlin-avdec1, libavifile-0.7c2, libmpeg3-1, libquicktime2, libv4l-0, libraw1394-11, libdc1394-22, libfftw3-3, libvorbis0a, libmp3lame0, libspeex1, libgsl0ldbl, python, libsmpeg0, libjpeg62, libflite1, libgsm1
Depends: python, fluid-soundfont-gm
Provides: pd-l2ork
Installed-Size: 90624
Recommends: xdg-utils, pulseaudio-utils, tap-plugins, ladspa-foo-plugins, invada-studio-plugins-ladspa, blepvco, swh-plugins, mcp-plugins, cmt, blop, slv2-jack, omins, ubuntustudio-audio-plugins, rev-plugins, dssi-utils, vco-plugins, wah-plugins, fil-plugins, mda-lv2
......
......@@ -40,7 +40,7 @@
and one unit thick \, through the points (0 \, 0) \, (w \, 0) \, (w
\, h) \, and (0 \, h). Note that the three points containing variables
become hot spots for mouse dragging.;
#X text 26 204 Draw the value of q as an Araboc numeral \, at (0 \,
#X text 26 204 Draw the value of q as an Arabic numeral \, at (0 \,
0) \, in black.;
#X obj 24 39 struct template3 float x float y float w float h float
q;
......
#N canvas 51 189 685 507 10;
#X text 36 21 fudiformat - convert lists to FUDI packets, f 61;
#X msg 72 127 1 2 3;
#X obj 180 312 fudiparse;
#X obj 72 311 print packet;
#X msg 342 389 disconnect;
#X obj 334 416 netsend -u -b;
#X msg 343 365 connect localhost 5000;
#X obj 335 315 list prepend send;
#X obj 335 340 list trim;
#X obj 180 337 print reassembled;
#X text 437 389 don't send;
#X text 530 364 send as UDP;
#X text 54 454 see also:;
#X obj 127 455 fudiparse;
#X obj 72 278 fudiformat;
#X msg 80 154 foo 4 5 weasel 6 7 rat;
#X text 125 128 FUDI messages with numbers and symbols.;
#X text 29 55 fudiformat makes FUDI messages suitable for sending over
the network via netsend (in UDP mode). Incoming messages are output
as FUDI messages \, byte by byte., f 61;
#X obj 439 250 fudiformat -u;
#X obj 127 475 oscformat;
#X text 281 193 The '-u' creation argument switches to "UDP" mode \,
omitting the packet separator. This saves some two bytes \, but only
works when sending single FUDI messages over UDP. It doesn't work with
TCP/IP (however \, you can use the default format even with UDP transport).
;
#X connect 1 0 14 0;
#X connect 2 0 9 0;
#X connect 4 0 5 0;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 8 0 5 0;
#X connect 14 0 3 0;
#X connect 14 0 7 0;
#X connect 14 0 2 0;
#X connect 15 0 14 0;
#N canvas 6 49 673 427 10;
#X obj 171 286 fudiparse;
#X text 52 373 see also:;
#X obj 171 309 print parse-output;
#X obj 419 231 netreceive -u -b;
#X msg 419 176 listen 5000;
#X msg 431 204 listen 0;
#X text 520 203 stop listening;
#X msg 57 181 1 2 3 foo 5;
#X text 51 156 numbers and symbols;
#X obj 57 286 print packet;
#X text 416 152 packets from network;
#X text 558 231 UDP packets \, binary output, f 13;
#X text 80 11 fudiparse - parse FUDI packets into Pd messages, f 67
;
#X obj 57 206 fudiformat;
#X obj 222 206 fudiformat -u;
#X text 220 159 without packet separator;
#X msg 222 181 flab -1 1.1;
#X obj 140 373 fudiformat;
#X obj 224 373 oscparse;
#X obj 222 226 t a a;
#X obj 57 226 t a a;
#X text 45 40 fudiparse takes incoming lists of numbers \, interpreting
them as the bytes in a FUDI message (as received when sending Pd-messages
via [netreceive -b]).;
#X text 521 176 listen on port 5000;
#X connect 0 0 2 0;
#X connect 3 0 0 0;
#X connect 4 0 3 0;
#X connect 5 0 3 0;
#X connect 7 0 13 0;
#X connect 13 0 20 0;
#X connect 14 0 19 0;
#X connect 16 0 14 0;
#X connect 19 0 0 0;
#X connect 19 1 9 0;
#X connect 20 0 0 0;
#X connect 20 1 9 0;
#N struct ;
#N canvas 355 65 579 812 12;
#N canvas 394 53 579 639 12;
#X declare;
#X obj 24 150 bang;
#X text 124 150 - output a bang message;
......@@ -398,7 +398,6 @@ its "help window".;
#X text 118 3676 - make copies of a subpatch;
#X obj 26 3676 clone;
#X obj 157 1167 midirealtimein;
#X obj 301 1169 midiclkin;
#X text 124 3530 - read with a time-varying delay time;
#X obj 97 3532 vd~;
#X obj 26 2081 rsqrt~;
......
......@@ -306,6 +306,8 @@
"viewbox_offsets": "Anzeigebox-Offsets",
"arrays": "Feld-Optionen"
},
"no_scroll": "Rollbalken verbergen (experimentell)",
"no_scroll_tt": "Rollbalken verbergen (experimentell)",
"gop": "Anzeige im übergeordneten Patch",
"gop_tt": "Zeige den Inhalt dieses Patches in einem Rechteck im übergeordneten Patch",
"hide_name": "Namen und Argumente verbergen",
......
......@@ -117,7 +117,7 @@ function nw_window_focus_callback(name) {
function nw_window_blur_callback(name) {
// Fake a mouseup event to keep from getting a dangling selection box
if (canvas_events.get_state === "normal") {
if (canvas_events.get_state() === "normal") {
pdgui.pdsend(name, "mouseup_fake");
}
}
......
......@@ -3575,7 +3575,7 @@ function gui_drawimage_new(obj_tag, file_path, canvasdir, flags) {
pd_cache.set(obj_tag, drawimage_data); // add the data to container
}
function gui_drawimage_free(obj_tag) {
function gui_image_free(obj_tag) {
var c = pd_cache.get(obj_tag);
if (c) {
pd_cache.free(obj_tag); // empty the image(s)
......
......@@ -231,19 +231,15 @@ void iemgui_receive(t_iemgui *x, t_symbol *s)
void iemgui_label(t_iemgui *x, t_symbol *s)
{
t_symbol *old;
if (s == &s_) s = s_empty; //tb: fix for empty label
old = x->x_lab;
t_symbol *lab = iemgui_raute2dollar(s);
x->x_lab_unexpanded = lab;
x->x_lab = lab = canvas_realizedollar(x->x_glist, lab);
if(glist_isvisible(x->x_glist))
{
gui_vmess("gui_iemgui_label_set", "xxs",
glist_getcanvas(x->x_glist),
x,
s != s_empty ? x->x_lab->s_name : "");
if (glist_isvisible(x->x_glist) && lab != old)
iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG);
}
}
void iemgui_label_pos(t_iemgui *x, t_symbol *s, int ac, t_atom *av)
......
......@@ -745,12 +745,12 @@ void canvas_scalar_event(t_canvas *x, t_symbol *s, int argc, t_atom *argv)
void canvas_show_scrollbars(t_canvas *x, t_floatarg f)
{
x->gl_noscroll = (int)f;
if (x->gl_mapped)
gui_vmess("gui_canvas_set_scrollbars", "xi", x, (int)f);
}
void canvas_show_menu(t_canvas *x, t_floatarg f)
{
post("setting nomenu to %d", f);
x->gl_nomenu = (int)f;
}
......@@ -826,13 +826,13 @@ void canvas_map(t_canvas *x, t_floatarg f)
t_gobj *y;
if (flag)
{
if (!glist_isvisible(x)) {
t_selection *sel;
if (!x->gl_havewindow)
{
bug("canvas_map");
canvas_vis(x, 1);
}
if (!x->gl_list) {
//if there are no objects on the canvas
canvas_create_editor(x);
......@@ -849,6 +849,7 @@ void canvas_map(t_canvas *x, t_floatarg f)
canvas_drawredrect(x, 1);
scrollbar_update(x);
}
}
else
{
//fprintf(stderr,"canvas_map 0\n");
......
......@@ -220,6 +220,13 @@ int gobj_shouldvis(t_gobj *x, struct _glist *glist)
//fprintf(stderr,"shouldvis %d %d %d %d\n",
// glist->gl_havewindow, glist->gl_isgraph,
// glist->gl_goprect, glist->gl_owner != NULL);
/* if our parent is a graph, and if that graph itself isn't
visible, then we aren't either. */
if (!glist->gl_havewindow && glist->gl_isgraph && glist->gl_owner
&& !gobj_shouldvis(&glist->gl_gobj, glist->gl_owner))
return (0);
/* if we're graphing-on-parent and the object falls outside the
graph rectangle, don't draw it. */
if (!glist->gl_havewindow && glist->gl_isgraph && glist->gl_goprect &&
glist->gl_owner && (pd_class(&x->g_pd) != scalar_class) &&
(pd_class(&x->g_pd) != garray_class))
......@@ -1329,6 +1336,14 @@ static void glist_doreload(t_glist *gl, t_symbol *name, t_symbol *dir,
do g = g->g_next in this case. */
//int j = glist_getindex(gl, g);
//fprintf(stderr, "rebuildlicious %d\n", j);
// Bugfix for cases where canvas_vis doesn't actually create a
// new editor. We need to fix canvas_vis so that the bug doesn't
// get triggered. But since we know this fixes a regression we'll
// keep this as a point in the history as we fix canvas_vis. Once
// that's done we can remove this call.
canvas_create_editor(gl);
if (!gl->gl_havewindow)
{
canvas_vis(glist_getcanvas(gl), 1);
......@@ -1380,7 +1395,7 @@ static void glist_doreload(t_glist *gl, t_symbol *name, t_symbol *dir,
them to reload an abstraction; also suppress window list update */
int glist_amreloadingabstractions = 0;
/* call canvas_doreload on everyone */
/* call glist_doreload on everyone */
void canvas_reload(t_symbol *name, t_symbol *dir, t_gobj *except)
{
t_canvas *x;
......@@ -2880,7 +2895,7 @@ static void canvas_donecanvasdialog(t_glist *x,
{
glist_noselect(x);
gobj_vis(&x->gl_gobj, x->gl_owner, 0);
if (gobj_shouldvis(&x->gl_obj, x->gl_owner))
if (gobj_shouldvis(&x->gl_gobj, x->gl_owner))
{
gobj_vis(&x->gl_gobj, x->gl_owner, 1);
//fprintf(stderr,"yes\n");
......
......@@ -311,10 +311,10 @@ void glist_grab(t_glist *x, t_gobj *y, t_glistmotionfn motionfn,
t_canvas *glist_getcanvas(t_glist *x)
{
//fprintf(stderr,"glist_getcanvas\n");
while (x->gl_owner && !x->gl_havewindow && x->gl_isgraph &&
gobj_shouldvis(&x->gl_gobj, x->gl_owner))
while (x->gl_owner && !x->gl_havewindow && x->gl_isgraph)
{
//fprintf(stderr,"x=%lx x->gl_owner=%d x->gl_havewindow=%d x->gl_isgraph=%d gobj_shouldvis=%d\n",
//fprintf(stderr,"x=%lx x->gl_owner=%d x->gl_havewindow=%d "
// "x->gl_isgraph=%d gobj_shouldvis=%d\n",
// x, (x->gl_owner ? 1:0), x->gl_havewindow, x->gl_isgraph,
// gobj_shouldvis(&x->gl_gobj, x->gl_owner));
x = x->gl_owner;
......@@ -1244,7 +1244,6 @@ static void graph_getrect(t_gobj *z, t_glist *glist,
int hadwindow;
t_gobj *g;
int x21, y21, x22, y22;
graph_graphrect(z, glist, &x1, &y1, &x2, &y2);
//fprintf(stderr,"%d %d %d %d\n", x1, y1, x2, y2);
......@@ -1266,7 +1265,6 @@ static void graph_getrect(t_gobj *z, t_glist *glist,
hadwindow = x->gl_havewindow;
x->gl_havewindow = 0;
for (g = x->gl_list; g; g = g->g_next)
if (gobj_shouldvis(g, x))
{
/* don't do this for arrays, just let them hang outside the
box. */
......@@ -1435,7 +1433,7 @@ static void graph_select(t_gobj *z, t_glist *glist, int state)
}
if (glist_isvisible(glist) &&
(glist_istoplevel(glist) ||
gobj_shouldvis(x, glist)))
gobj_shouldvis(z, glist)))
{
if (state)
gui_vmess("gui_gobj_select", "xs",
......
......@@ -28,7 +28,7 @@ void my_canvas_draw_new(t_my_canvas *x, t_glist *glist)
sprintf(cbuf, "#%6.6x", x->x_gui.x_bcol);
gui_vmess("gui_gobj_new", "xxsiii", canvas,
x, "iemgui", x1, y1, glist_istoplevel(canvas));
x, "iemgui", x1, y1, glist_istoplevel(glist));
gui_vmess("gui_mycanvas_new", "xxsiiiiii", canvas,
x, cbuf, x1, y1, x1+x->x_vis_w, y1+x->x_vis_h,
x1+x->x_gui.x_w, y1+x->x_gui.x_h);
......
......@@ -402,6 +402,8 @@ void canvas_doaddtemplate(t_symbol *templatesym,
static void glist_writelist(t_gobj *y, t_binbuf *b);
void binbuf_savetext(t_binbuf *bfrom, t_binbuf *bto);
void canvas_writescalar(t_symbol *templatesym, t_word *w, t_binbuf *b,
int amarrayelement)
{
......
......@@ -363,12 +363,6 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto,
}
else if (ds->ds_type == DT_ARRAY)
{
t_symbol *arraytemplate = ds->ds_fieldtemplate;
if (arraytemplate == tfrom->t_sym ||
arraytemplate == tto->t_sym)
{
return 0;
}
template_conformarray(tfrom, tto, conformaction,
x->sc_vec[i].w_array);
}
......@@ -1744,8 +1738,15 @@ void svg_sendupdate(t_svg *x, t_canvas *c, t_symbol *s,
need to experiment with gop scalars to make sure I'm not breaking
anything */
char tag[MAXPDSTRING];
int index = (array ?
((((char *)data) - array->a_vec) / array->a_elemsize) : -1);
int index;
if (array)
{
int elemsize = array->a_elemsize;
if (!elemsize) elemsize = 1;
index = (((char *)data) - array->a_vec) / elemsize;
}
else
index = -1;
if (x->x_type == gensym("g") || x->x_type == gensym("svg"))
{
sprintf(tag, "dgroup%lx.%lx",
......@@ -2141,7 +2142,22 @@ void svg_register_events(t_gobj *z, t_canvas *c, t_scalar *sc,
t_template *template, t_word *data, t_array *a)
{
t_svg *svg;
int index = (a ? ((((char *)data) - a->a_vec) / a->a_elemsize) : -1);
int index;
if (a)
{
int elemsize = a->a_elemsize;
/* avoid divide-by-zero in case our elemsize is 0. Currently
there's no practical use case for an array of elements which
have zero size as there's no way to differentiate their
visualization. However if [draw array] changes in the future
to allow spacing out element groups or something like that,
we will have to revisit this workaround we're using to get
the element's index. */
if (!elemsize) elemsize = 1;
index = (((char *)data) - a->a_vec) / elemsize;
}
else
index = -1;
char tagbuf[MAXPDSTRING];
if (pd_class(&z->g_pd) == canvas_class)
{
......@@ -2161,9 +2177,8 @@ void svg_register_events(t_gobj *z, t_canvas *c, t_scalar *sc,
sprintf(tagbuf, "draw%lx.%lx", (long unsigned int)z,
(long unsigned int)data);
}
else
else /* legacy drawing commands: curve, drawnumber, etc. */
{
error("scalar: can't set event for unknown drawing command");
return;
}
if (svg->x_events.e_mouseover.a_flag)
......@@ -2230,8 +2245,6 @@ void svg_setattr(t_svg *x, t_symbol *s, t_int argc, t_atom *argv)
the arguments in an existing [draw svg] object. */
void svg_update_args(t_svg *x, t_symbol *s, int argc, t_atom *argv)
{
post("made it to args");
if (argc) post("first arg is %s", atom_getsymbolarg(0, argc, argv)->s_name);
/* "g" doesn't take any args, so check for "svg" arg */
if (atom_getsymbolarg(0, argc, argv) == gensym("svg"))
{
......@@ -4470,34 +4483,47 @@ static int draw_click(t_gobj *z, t_glist *glist,
But the one person I know who uses nested ds arrays hasn't asked for
that, so let's see if we can just make it to the end of this software's
life before that happens. */
static void scalar_spelunkforword(t_scalar *x, t_symbol *s, int word_index,
t_array **array, t_word **data)
static void scalar_spelunkforword(void* word_candidate, t_template* template,
t_word *data, int word_index, t_array **arrayp, t_word **datap)
{
/* from glob_findinstance */
long obj = 0;
if (sscanf(s->s_name, "x%lx", &obj))
{
t_template *template = template_findbyname(x->sc_template);
if (!template)
{
pd_error(x, "scalar: template disappeared before notification "
"from gui arrived");
return;
}
int i, nitems = template->t_n;
t_dataslot *datatypes = template->t_vec;
t_word *wp = x->sc_vec;
t_word *wp = data;
for (i = 0; i < nitems; i++, datatypes++, wp++)
{
if (datatypes->ds_type == DT_ARRAY &&
((void *)wp->w_array) == (void *)obj &&
word_index < wp->w_array->a_n)
((void *)wp->w_array) == (void *)word_candidate)
{
*array = wp->w_array;
*data = ((t_word *)(wp->w_array->a_vec +
/* Make sure we're in range, as the array could have been
resized. In that case simply return */
if (word_index >= wp->w_array->a_n) return;
*arrayp = wp->w_array;
*datap = ((t_word *)(wp->w_array->a_vec +
word_index * wp->w_array->a_elemsize));
return;
}
}
/* Now swoop through the headers again and recursively search
any arrays for nested data. We do this as a second step so
that toplevel arrays don't take a performance hit from deeply
nested arrays. (Probably not a big deal for click events, but
for complex data structures it could be noticeable for drag
events */
wp = data;
datatypes = template->t_vec;
for (i = 0; i < nitems; i++, datatypes++, wp++)
if (datatypes->ds_type == DT_ARRAY)
{
t_template* t = template_findbyname(wp->w_array->a_templatesym);
if (t)
{
int i, elemsize = wp->w_array->a_elemsize;
char *vec;
for(i = 0, vec = wp->w_array->a_vec; i < wp->w_array->a_n; i++)
scalar_spelunkforword(word_candidate, t,
(t_word *)(wp->w_array->a_vec + i * elemsize),
word_index, arrayp, datap);
}
}
}
......@@ -4526,11 +4552,24 @@ void draw_notify(t_canvas *x, t_symbol *s, int argc, t_atom *argv)
or greater then that's what we have */
if (index > -1)
{
scalar_spelunkforword(sc, array_sym, index, &a, &data);
t_template *template = template_findbyname(sc->sc_template);
if (!template)
{
pd_error(sc, "scalar: template disappeared before notification "
"from gui arrived");
return;
}
long word_candidate = 0; /* from glob_findinstance */
if (!sscanf(array_sym->s_name, "x%lx", &word_candidate))
{
pd_error(sc, "scalar: couldn't read array datum from GUI");
return;
}
scalar_spelunkforword((void *)word_candidate, template, sc->sc_vec,
index, &a, &data);
if (!data)
{
pd_error(x, "scalar: couldn't get array data for event "
"callback");
pd_error(x, "scalar: couldn't get array data for event callback");
return;
}
}
......@@ -8460,7 +8499,7 @@ static void drawimage_free(t_drawimage *x)
//sprintf(buf, ".x%lx", (t_int)x);
sprintf(buf, "x%lx", (long unsigned int)x);
pd_unbind(&x->x_obj.ob_pd, gensym(buf));
gui_vmess("gui_drawimage_free", "x", x);
gui_vmess("gui_image_free", "x", x);
}
static void drawimage_setup(void)
......
......@@ -74,7 +74,6 @@ struct _pdinstance
t_symbol *pd_bendin_sym;
t_symbol *pd_touchin_sym;
t_symbol *pd_polytouchin_sym;
t_symbol *pd_midiclkin_sym;
t_symbol *pd_midirealtimein_sym;
};
......
......@@ -478,7 +478,6 @@ static t_pdinstance *pdinstance_donew(int useprefix)
x->pd_bendin_sym = midi_gensym(midiprefix, "#bendin");
x->pd_touchin_sym = midi_gensym(midiprefix, "#touchin");
x->pd_polytouchin_sym = midi_gensym(midiprefix, "#polytouchin");
x->pd_midiclkin_sym = midi_gensym(midiprefix, "#midiclkin");
x->pd_midirealtimein_sym = midi_gensym(midiprefix, "#midirealtimein");
return (x);
}
......
......@@ -14,7 +14,7 @@ extern "C" {
#define PD_MINOR_VERSION 48
#define PD_BUGFIX_VERSION 0
#define PD_TEST_VERSION ""
#define PD_L2ORK_VERSION "2.4.3"
#define PD_L2ORK_VERSION "2.4.7"
#define PDL2ORK
extern int pd_compatibilitylevel; /* e.g., 43 for pd 0.43 compatibility */
......
......@@ -46,7 +46,7 @@ void sys_doflags( void);
#ifdef UNIX
#define USER_CONFIG_DIR ".pd-l2ork"
#define USER_CONFIG_DIR ".purr-data"
static char *sys_prefbuf;
......
......@@ -462,7 +462,7 @@ static t_pd *do_create_abstraction(t_symbol*s, int argc, t_atom *argv)
const char *objectname = s->s_name;
char dirbuf[MAXPDSTRING], classslashclass[MAXPDSTRING], *nameptr;
t_glist *glist = (t_glist *)canvas_getcurrent();
t_canvas *canvas = (t_canvas*)glist_getcanvas(glist);
t_canvas *canvas = (t_canvas*)canvas_getrootfor(glist);
int fd = -1;
t_pd *was = s__X.s_thing;
......
......@@ -239,11 +239,6 @@ void outmidi_polyaftertouch(int portno, int channel, int pitch, int value)
pitch, value);
}
void outmidi_mclk(int portno)
{
sys_queuemidimess(portno, 1, 0xf8, 0,0);
}
void outmidi_byte(int portno, int value)
{
#ifdef USEAPI_ALSA
......@@ -291,7 +286,6 @@ typedef struct midiparser
/* functions in x_midi.c */
void inmidi_realtimein(int portno, int cmd);
void inmidi_clk(double timing);
void inmidi_byte(int portno, int byte);
void inmidi_sysex(int portno, int byte);
void inmidi_noteon(int portno, int channel, int pitch, int velo);
......@@ -316,14 +310,6 @@ static void sys_dispatchnextmidiin( void)
if (byte >= 0xf8)
{
inmidi_realtimein(portno, byte);
if (byte == 0xf8) {
// AG: Not sure what the timebase for the right outlet is supposed
// to be. I'm using msecs right now, which is in line with the other
// tempo-related objects such as metro. Multiply with .001 to
// get seconds instead.
double timing = clock_gettimesince(sys_midiinittime);
inmidi_clk(timing);
}
}
else
{
......
......@@ -440,7 +440,7 @@ EXTERN void alist_init(t_alist *x);
EXTERN void alist_clear(t_alist *x);
EXTERN void alist_list(t_alist *x, t_symbol *s, int argc, t_atom *argv);
EXTERN void alist_anything(t_alist *x, t_symbol *s, int argc, t_atom *argv);
EXTERN void alist_toatoms(t_alist *x, t_atom *to);
EXTERN void alist_clone(t_alist *x, t_alist *y);
EXTERN void alist_toatoms(t_alist *x, t_atom *to, int onset, int count);
EXTERN void alist_clone(t_alist *x, t_alist *y, int onset, int count);
#endif /* __s_stuff_h_ */
......@@ -79,8 +79,6 @@ void alist_init(t_alist *x)
void alist_clear(t_alist *x)
{
if (x->l_n)
{
int i;
for (i = 0; i < x->l_n; i++)
{
......@@ -89,11 +87,25 @@ void alist_clear(t_alist *x)
}
if (x->l_vec)
freebytes(x->l_vec, x->l_n * sizeof(*x->l_vec));
}
static void alist_copyin(t_alist *x, t_symbol *s, int argc, t_atom *argv,
int where)
{