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 ...@@ -354,7 +354,7 @@ The following is adapted from Pd Vanilla's original source notes. (Found
in pd/src/CHANGELOG.txt for some reason...) in pd/src/CHANGELOG.txt for some reason...)
Sections 2-3 below are quite old. Someone needs to check whether they even 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. #### Structure definition roadmap.
...@@ -390,7 +390,7 @@ Other structures: ...@@ -390,7 +390,7 @@ Other structures:
#### 1. Coding Style #### 1. Coding Style
1.0 C coding style. The source should pass most "warnings" of C compilers 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 are intentional, for instance the loose use of function prototypes (see
below) and uncast conversions from longer to shorter numerical formats. below) and uncast conversions from longer to shorter numerical formats.
The code doesn't respect "const" yet. The code doesn't respect "const" yet.
......
...@@ -81,7 +81,8 @@ deb: $(debsrc) $(addprefix debian/nwjs/, $(nwjs)) ...@@ -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. # This can be removed once Ubuntu 12.04 finally goes the way of the dodo.
# cd $(debdist) && patch -p1 < ../precise-configure.patch # cd $(debdist) && patch -p1 < ../precise-configure.patch
# Patch the user config dir name so that purr-data can coexist with pd-l2ork. # 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. # Make sure to copy the Debian files which may have uncommitted changes.
# Then run debuild to create the package. # Then run debuild to create the package.
cd $(debdist) && cp -R ../debian . && debuild $(DEBUILD_FLAGS) cd $(debdist) && cp -R ../debian . && debuild $(DEBUILD_FLAGS)
......
...@@ -465,7 +465,7 @@ static void image_setwidget(void) ...@@ -465,7 +465,7 @@ static void image_setwidget(void)
static void image_free(t_image *x) static void image_free(t_image *x)
{ {
//sys_vgui("image delete img%x\n", 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) if (x->x_receive)
{ {
pd_unbind(&x->x_obj.ob_pd,x->x_receive); pd_unbind(&x->x_obj.ob_pd,x->x_receive);
......
...@@ -305,8 +305,8 @@ static void imagebang_free(t_imagebang *x) { ...@@ -305,8 +305,8 @@ static void imagebang_free(t_imagebang *x) {
sprintf(key_a, "%lx_a", (long unsigned int)x); sprintf(key_a, "%lx_a", (long unsigned int)x);
sprintf(key_b, "%lx_b", (long unsigned int)x); sprintf(key_b, "%lx_b", (long unsigned int)x);
gui_vmess("gui_drawimage_free", "s", key_a); gui_vmess("gui_image_free", "s", key_a);
gui_vmess("gui_drawimage_free", "s", key_b); gui_vmess("gui_image_free", "s", key_b);
if (x->receive) { if (x->receive) {
pd_unbind(&x->x_obj.ob_pd,x->receive); pd_unbind(&x->x_obj.ob_pd,x->receive);
} }
......
...@@ -12,18 +12,16 @@ BUILDLAYOUT_DIR = $(cvs_root_dir)/packages ...@@ -12,18 +12,16 @@ BUILDLAYOUT_DIR = $(cvs_root_dir)/packages
include $(BUILDLAYOUT_DIR)/Makefile.buildlayout include $(BUILDLAYOUT_DIR)/Makefile.buildlayout
# if machine has dpkg-deb, build a Debian package # if machine has dpkg-deb, build a Debian package
#ifeq ($(shell test -x /usr/bin/dpkg-deb && echo YES),YES) ifeq ($(shell test -x /usr/bin/dpkg-deb && echo YES),YES)
# PACKAGE_TYPE = deb PACKAGE_TYPE = deb
#else else
# PACKAGE_TYPE = tarbz2 PACKAGE_TYPE = tarbz2
#endif endif
# for command-line UNIX versions, you need to install Pd into the same # 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. # directory as $(prefix) otherwise Pd won't be able to find extra, doc, etc.
ifeq ($(PACKAGE_TYPE),deb) ifeq ($(PACKAGE_TYPE),deb)
prefix = /usr 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 else
prefix = /usr/local prefix = /usr/local
endif endif
...@@ -160,6 +158,9 @@ deb: debstage ...@@ -160,6 +158,9 @@ deb: debstage
cp $(packages_src)/linux_make/debian/control $(DESTDIR)/DEBIAN 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.postrm $(DESTDIR)/DEBIAN
cp $(packages_src)/linux_make/debian/pd-l2ork.postinst $(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 # set build architecture and version for the package
sed -i 's|^Version:.*|Version: $(DEB_PD_VERSION)|' \ sed -i 's|^Version:.*|Version: $(DEB_PD_VERSION)|' \
$(DESTDIR)/DEBIAN/control $(DESTDIR)/DEBIAN/control
...@@ -279,7 +280,7 @@ test_locations: ...@@ -279,7 +280,7 @@ test_locations:
@echo "EXAMPLESDIR $(examplesdir)" @echo "EXAMPLESDIR $(examplesdir)"
@echo -------------------------------------------------- @echo --------------------------------------------------
# @echo "PACKAGE_DEPENDS $(PACKAGE_DEPENDS)" # @echo "PACKAGE_DEPENDS $(PACKAGE_DEPENDS)"
# @echo -------------------------------------------------- @echo --------------------------------------------------
autoconf --version autoconf --version
@echo -------------------------------------------------- @echo --------------------------------------------------
make --version make --version
......
...@@ -6,7 +6,7 @@ Maintainer: Ivica Ico Bukvic <ico@vt.edu> ...@@ -6,7 +6,7 @@ Maintainer: Ivica Ico Bukvic <ico@vt.edu>
Homepage: http://l2ork.music.vt.edu Homepage: http://l2ork.music.vt.edu
Package: pd-l2ork Package: pd-l2ork
Architecture: i386 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 Provides: pd-l2ork
Installed-Size: 90624 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 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> ...@@ -6,7 +6,7 @@ Maintainer: Ivica Ico Bukvic <ico@vt.edu>
Homepage: http://l2ork.music.vt.edu Homepage: http://l2ork.music.vt.edu
Package: pd-l2ork Package: pd-l2ork
Architecture: i386 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 Provides: pd-l2ork
Installed-Size: 90624 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 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> ...@@ -6,7 +6,7 @@ Maintainer: Ivica Ico Bukvic <ico@vt.edu>
Homepage: http://l2ork.music.vt.edu Homepage: http://l2ork.music.vt.edu
Package: pd-l2ork Package: pd-l2ork
Architecture: i386 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 Provides: pd-l2ork
Installed-Size: 90624 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 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> ...@@ -6,7 +6,7 @@ Maintainer: Ivica Ico Bukvic <ico@vt.edu>
Homepage: http://l2ork.music.vt.edu Homepage: http://l2ork.music.vt.edu
Package: pd-l2ork Package: pd-l2ork
Architecture: i386 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 Provides: pd-l2ork
Installed-Size: 90624 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 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 @@ ...@@ -40,7 +40,7 @@
and one unit thick \, through the points (0 \, 0) \, (w \, 0) \, (w and one unit thick \, through the points (0 \, 0) \, (w \, 0) \, (w
\, h) \, and (0 \, h). Note that the three points containing variables \, h) \, and (0 \, h). Note that the three points containing variables
become hot spots for mouse dragging.; 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.; 0) \, in black.;
#X obj 24 39 struct template3 float x float y float w float h float #X obj 24 39 struct template3 float x float y float w float h float
q; 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 struct ;
#N canvas 355 65 579 812 12; #N canvas 394 53 579 639 12;
#X declare; #X declare;
#X obj 24 150 bang; #X obj 24 150 bang;
#X text 124 150 - output a bang message; #X text 124 150 - output a bang message;
...@@ -398,7 +398,6 @@ its "help window".; ...@@ -398,7 +398,6 @@ its "help window".;
#X text 118 3676 - make copies of a subpatch; #X text 118 3676 - make copies of a subpatch;
#X obj 26 3676 clone; #X obj 26 3676 clone;
#X obj 157 1167 midirealtimein; #X obj 157 1167 midirealtimein;
#X obj 301 1169 midiclkin;
#X text 124 3530 - read with a time-varying delay time; #X text 124 3530 - read with a time-varying delay time;
#X obj 97 3532 vd~; #X obj 97 3532 vd~;
#X obj 26 2081 rsqrt~; #X obj 26 2081 rsqrt~;
......
...@@ -306,6 +306,8 @@ ...@@ -306,6 +306,8 @@
"viewbox_offsets": "Anzeigebox-Offsets", "viewbox_offsets": "Anzeigebox-Offsets",
"arrays": "Feld-Optionen" "arrays": "Feld-Optionen"
}, },
"no_scroll": "Rollbalken verbergen (experimentell)",
"no_scroll_tt": "Rollbalken verbergen (experimentell)",
"gop": "Anzeige im übergeordneten Patch", "gop": "Anzeige im übergeordneten Patch",
"gop_tt": "Zeige den Inhalt dieses Patches in einem Rechteck im übergeordneten Patch", "gop_tt": "Zeige den Inhalt dieses Patches in einem Rechteck im übergeordneten Patch",
"hide_name": "Namen und Argumente verbergen", "hide_name": "Namen und Argumente verbergen",
......
...@@ -117,7 +117,7 @@ function nw_window_focus_callback(name) { ...@@ -117,7 +117,7 @@ function nw_window_focus_callback(name) {
function nw_window_blur_callback(name) { function nw_window_blur_callback(name) {
// Fake a mouseup event to keep from getting a dangling selection box // 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"); pdgui.pdsend(name, "mouseup_fake");
} }
} }
......
...@@ -3575,7 +3575,7 @@ function gui_drawimage_new(obj_tag, file_path, canvasdir, flags) { ...@@ -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 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); var c = pd_cache.get(obj_tag);
if (c) { if (c) {
pd_cache.free(obj_tag); // empty the image(s) pd_cache.free(obj_tag); // empty the image(s)
......
...@@ -231,19 +231,15 @@ void iemgui_receive(t_iemgui *x, t_symbol *s) ...@@ -231,19 +231,15 @@ void iemgui_receive(t_iemgui *x, t_symbol *s)
void iemgui_label(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 if (s == &s_) s = s_empty; //tb: fix for empty label
old = x->x_lab;
t_symbol *lab = iemgui_raute2dollar(s); t_symbol *lab = iemgui_raute2dollar(s);
x->x_lab_unexpanded = lab; x->x_lab_unexpanded = lab;
x->x_lab = lab = canvas_realizedollar(x->x_glist, lab); x->x_lab = lab = canvas_realizedollar(x->x_glist, lab);
if(glist_isvisible(x->x_glist)) if (glist_isvisible(x->x_glist) && lab != old)
{
gui_vmess("gui_iemgui_label_set", "xxs",
glist_getcanvas(x->x_glist),
x,
s != s_empty ? x->x_lab->s_name : "");
iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG); iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG);
}
} }
void iemgui_label_pos(t_iemgui *x, t_symbol *s, int ac, t_atom *av) 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) ...@@ -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) void canvas_show_scrollbars(t_canvas *x, t_floatarg f)
{ {
x->gl_noscroll = (int)f; x->gl_noscroll = (int)f;
if (x->gl_mapped)
gui_vmess("gui_canvas_set_scrollbars", "xi", x, (int)f); gui_vmess("gui_canvas_set_scrollbars", "xi", x, (int)f);
} }
void canvas_show_menu(t_canvas *x, t_floatarg f) void canvas_show_menu(t_canvas *x, t_floatarg f)
{ {
post("setting nomenu to %d", f);
x->gl_nomenu = (int)f; x->gl_nomenu = (int)f;
} }
...@@ -826,13 +826,13 @@ void canvas_map(t_canvas *x, t_floatarg f) ...@@ -826,13 +826,13 @@ void canvas_map(t_canvas *x, t_floatarg f)
t_gobj *y; t_gobj *y;
if (flag) if (flag)
{ {
if (!glist_isvisible(x)) {
t_selection *sel; t_selection *sel;
if (!x->gl_havewindow) if (!x->gl_havewindow)
{ {
bug("canvas_map"); bug("canvas_map");
canvas_vis(x, 1); canvas_vis(x, 1);
} }
if (!x->gl_list) { if (!x->gl_list) {
//if there are no objects on the canvas //if there are no objects on the canvas
canvas_create_editor(x); canvas_create_editor(x);
...@@ -849,6 +849,7 @@ void canvas_map(t_canvas *x, t_floatarg f) ...@@ -849,6 +849,7 @@ void canvas_map(t_canvas *x, t_floatarg f)
canvas_drawredrect(x, 1); canvas_drawredrect(x, 1);
scrollbar_update(x); scrollbar_update(x);
} }
}
else else
{ {
//fprintf(stderr,"canvas_map 0\n"); //fprintf(stderr,"canvas_map 0\n");
......
...@@ -220,6 +220,13 @@ int gobj_shouldvis(t_gobj *x, struct _glist *glist) ...@@ -220,6 +220,13 @@ int gobj_shouldvis(t_gobj *x, struct _glist *glist)
//fprintf(stderr,"shouldvis %d %d %d %d\n", //fprintf(stderr,"shouldvis %d %d %d %d\n",
// glist->gl_havewindow, glist->gl_isgraph, // glist->gl_havewindow, glist->gl_isgraph,
// glist->gl_goprect, glist->gl_owner != NULL); // 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 && if (!glist->gl_havewindow && glist->gl_isgraph && glist->gl_goprect &&
glist->gl_owner && (pd_class(&x->g_pd) != scalar_class) && glist->gl_owner && (pd_class(&x->g_pd) != scalar_class) &&
(pd_class(&x->g_pd) != garray_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, ...@@ -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. */ do g = g->g_next in this case. */
//int j = glist_getindex(gl, g); //int j = glist_getindex(gl, g);
//fprintf(stderr, "rebuildlicious %d\n", j); //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) if (!gl->gl_havewindow)
{ {
canvas_vis(glist_getcanvas(gl), 1); canvas_vis(glist_getcanvas(gl), 1);
...@@ -1380,7 +1395,7 @@ static void glist_doreload(t_glist *gl, t_symbol *name, t_symbol *dir, ...@@ -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 */ them to reload an abstraction; also suppress window list update */
int glist_amreloadingabstractions = 0; 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) void canvas_reload(t_symbol *name, t_symbol *dir, t_gobj *except)
{ {
t_canvas *x; t_canvas *x;
...@@ -2880,7 +2895,7 @@ static void canvas_donecanvasdialog(t_glist *x, ...@@ -2880,7 +2895,7 @@ static void canvas_donecanvasdialog(t_glist *x,
{ {
glist_noselect(x); glist_noselect(x);
gobj_vis(&x->gl_gobj, x->gl_owner, 0); 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); gobj_vis(&x->gl_gobj, x->gl_owner, 1);
//fprintf(stderr,"yes\n"); //fprintf(stderr,"yes\n");
......
...@@ -311,10 +311,10 @@ void glist_grab(t_glist *x, t_gobj *y, t_glistmotionfn motionfn, ...@@ -311,10 +311,10 @@ void glist_grab(t_glist *x, t_gobj *y, t_glistmotionfn motionfn,
t_canvas *glist_getcanvas(t_glist *x) t_canvas *glist_getcanvas(t_glist *x)
{ {
//fprintf(stderr,"glist_getcanvas\n"); //fprintf(stderr,"glist_getcanvas\n");
while (x->gl_owner && !x->gl_havewindow && x->gl_isgraph && while (x->gl_owner && !x->gl_havewindow && x->gl_isgraph)
gobj_shouldvis(&x->gl_gobj, x->gl_owner))
{ {
//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, // x, (x->gl_owner ? 1:0), x->gl_havewindow, x->gl_isgraph,
// gobj_shouldvis(&x->gl_gobj, x->gl_owner)); // gobj_shouldvis(&x->gl_gobj, x->gl_owner));
x = x->gl_owner; x = x->gl_owner;
...@@ -1244,7 +1244,6 @@ static void graph_getrect(t_gobj *z, t_glist *glist, ...@@ -1244,7 +1244,6 @@ static void graph_getrect(t_gobj *z, t_glist *glist,
int hadwindow; int hadwindow;
t_gobj *g; t_gobj *g;
int x21, y21, x22, y22; int x21, y21, x22, y22;
graph_graphrect(z, glist, &x1, &y1, &x2, &y2); graph_graphrect(z, glist, &x1, &y1, &x2, &y2);
//fprintf(stderr,"%d %d %d %d\n", 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, ...@@ -1266,7 +1265,6 @@ static void graph_getrect(t_gobj *z, t_glist *glist,
hadwindow = x->gl_havewindow; hadwindow = x->gl_havewindow;
x->gl_havewindow = 0; x->gl_havewindow = 0;
for (g = x->gl_list; g; g = g->g_next) 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 /* don't do this for arrays, just let them hang outside the
box. */ box. */
...@@ -1435,7 +1433,7 @@ static void graph_select(t_gobj *z, t_glist *glist, int state) ...@@ -1435,7 +1433,7 @@ static void graph_select(t_gobj *z, t_glist *glist, int state)
} }
if (glist_isvisible(glist) && if (glist_isvisible(glist) &&
(glist_istoplevel(glist) || (glist_istoplevel(glist) ||
gobj_shouldvis(x, glist))) gobj_shouldvis(z, glist)))
{ {
if (state) if (state)
gui_vmess("gui_gobj_select", "xs", gui_vmess("gui_gobj_select", "xs",
......
...@@ -28,7 +28,7 @@ void my_canvas_draw_new(t_my_canvas *x, t_glist *glist) ...@@ -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); sprintf(cbuf, "#%6.6x", x->x_gui.x_bcol);
gui_vmess("gui_gobj_new", "xxsiii", canvas, 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, gui_vmess("gui_mycanvas_new", "xxsiiiiii", canvas,
x, cbuf, x1, y1, x1+x->x_vis_w, y1+x->x_vis_h, 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); x1+x->x_gui.x_w, y1+x->x_gui.x_h);
......
...@@ -402,6 +402,8 @@ void canvas_doaddtemplate(t_symbol *templatesym, ...@@ -402,6 +402,8 @@ void canvas_doaddtemplate(t_symbol *templatesym,
static void glist_writelist(t_gobj *y, t_binbuf *b); 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, void canvas_writescalar(t_symbol *templatesym, t_word *w, t_binbuf *b,
int amarrayelement) int amarrayelement)
{ {
......
...@@ -363,12 +363,6 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto, ...@@ -363,12 +363,6 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto,
} }
else if (ds->ds_type == DT_ARRAY) 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, template_conformarray(tfrom, tto, conformaction,
x->sc_vec[i].w_array); x->sc_vec[i].w_array);
} }
...@@ -1744,8 +1738,15 @@ void svg_sendupdate(t_svg *x, t_canvas *c, t_symbol *s, ...@@ -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 need to experiment with gop scalars to make sure I'm not breaking
anything */ anything */
char tag[MAXPDSTRING]; char tag[MAXPDSTRING];
int index = (array ? int index;
((((char *)data) - array->a_vec) / array->a_elemsize) : -1); 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")) if (x->x_type == gensym("g") || x->x_type == gensym("svg"))
{ {
sprintf(tag, "dgroup%lx.%lx", sprintf(tag, "dgroup%lx.%lx",
...@@ -2141,7 +2142,22 @@ void svg_register_events(t_gobj *z, t_canvas *c, t_scalar *sc, ...@@ -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_template *template, t_word *data, t_array *a)
{ {
t_svg *svg; 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]; char tagbuf[MAXPDSTRING];
if (pd_class(&z->g_pd) == canvas_class) 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, ...@@ -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, sprintf(tagbuf, "draw%lx.%lx", (long unsigned int)z,
(long unsigned int)data); (long unsigned int)data);
} }
else else /* legacy drawing commands: curve, drawnumber, etc. */
{ {
error("scalar: can't set event for unknown drawing command");
return; return;
} }
if (svg->x_events.e_mouseover.a_flag) 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) ...@@ -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. */ the arguments in an existing [draw svg] object. */
void svg_update_args(t_svg *x, t_symbol *s, int argc, t_atom *argv) 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 */ /* "g" doesn't take any args, so check for "svg" arg */
if (atom_getsymbolarg(0, argc, argv) == gensym("svg")) if (atom_getsymbolarg(0, argc, argv) == gensym("svg"))
{ {
...@@ -4470,34 +4483,47 @@ static int draw_click(t_gobj *z, t_glist *glist, ...@@ -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 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 that, so let's see if we can just make it to the end of this software's
life before that happens. */ life before that happens. */
static void scalar_spelunkforword(t_scalar *x, t_symbol *s, int word_index, static void scalar_spelunkforword(void* word_candidate, t_template* template,
t_array **array, t_word **data) 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)