Commit bc0d70c7 authored by Jonathan Wilkes's avatar Jonathan Wilkes

Merge branch 'aggraef/purr-data-release_2.15.0'

parents c4495143 daf883f9
Pipeline #2948 failed with stage
in 209 minutes and 13 seconds
......@@ -528,7 +528,7 @@ static void knob_click(t_knob *x, t_floatarg xpos, t_floatarg ypos,
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
knob_bang(x);
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)knob_motion,
0, xpos, ypos);
0, 0, xpos, ypos);
}
static int knob_newclick(t_gobj *z, struct _glist *glist,
......
......@@ -541,7 +541,7 @@ static int envgen_newclick(t_envgen *x, struct _glist *glist,
envgen_next_doodle(x, glist, xpos, ypos);
glist_grab(x->w.glist, &x->x_obj.te_g, (t_glistmotionfn) envgen_motion,
(t_glistkeyfn) envgen_key, xpos, ypos);
(t_glistkeyfn) envgen_key, 0, xpos, ypos);
x->resizing = 0;
if (x->resizeable && (xpos > wxpos + x->w.width) &&
......
......@@ -366,7 +366,7 @@ static void cube_sphere_click(t_cube_sphere *x, t_floatarg xpos, t_floatarg ypos
x->x_sel_index = sel;
x->x_pos_x = x->x_pix_src_x[sel];
x->x_pos_y = x->x_pix_src_y[sel];
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)cube_sphere_motion, 0, xpos, ypos);
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)cube_sphere_motion, 0, 0, xpos, ypos);
}
}
}
......
......@@ -232,7 +232,7 @@ static int iem_event_click(t_gobj *z, struct _glist *glist, int xpix, int ypix,
if(doit)
{
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)iem_event_motion, iem_event_key, (t_float)xpix, (t_float)ypix);
(t_glistmotionfn)iem_event_motion, iem_event_key, 0, (t_float)xpix, (t_float)ypix);
outlet_anything(x->x_gui.x_obj.ob_outlet, x->x_dragg_x_y, 2, x->x_at_out);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
......
......@@ -716,7 +716,7 @@ static void numberbox_matrix_click(t_numberbox_matrix *x, t_floatarg xpos, t_flo
t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
{
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)numberbox_matrix_motion, numberbox_matrix_key, xpos, ypos);
(t_glistmotionfn)numberbox_matrix_motion, numberbox_matrix_key, 0, xpos, ypos);
}
static int numberbox_matrix_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit)
......
......@@ -440,7 +440,7 @@ static void room_sim_2d_click(t_room_sim_2d *x, t_floatarg xpos, t_floatarg ypos
x->x_pos_x = x->x_pix_src_x[sel];
x->x_pos_y = x->x_pix_src_y[sel];
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)room_sim_2d_motion, 0, xpos, ypos);
(t_glistmotionfn)room_sim_2d_motion, 0, 0, xpos, ypos);
}
}
......
......@@ -532,7 +532,7 @@ static void room_sim_3d_click(t_room_sim_3d *x, t_floatarg xpos, t_floatarg ypos
x->x_pos_x = x->x_pix_src_x[sel];
x->x_pos_y = x->x_pix_src_y[sel];
x->x_pos_z = x->x_pix_src_z[sel];
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)room_sim_3d_motion, 0, xpos, ypos);
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)room_sim_3d_motion, 0, 0, xpos, ypos);
}
}
......
......@@ -195,7 +195,7 @@ static void comment_dograb(t_comment *x)
Here we use it just to prevent backspace from erasing entire text.
This has to be done also when we are already active, because
after being clicked at we have lost our previous grab. */
glist_grab(x->x_glist, (t_gobj *)x, 0, comment_grabbedkey, 0, 0);
glist_grab(x->x_glist, (t_gobj *)x, 0, comment_grabbedkey, 0, 0, 0);
}
static void comment__bboxhook(t_comment *x, t_symbol *bindsym,
......
......@@ -188,7 +188,9 @@ void hammereditor_open(t_hammerfile *f, char *title, char *owner)
static void hammereditor_tick(t_hammerfile *f)
{
sys_vgui("hammereditor_close .%x 1\n", (int)f);
// ico@vt.edu 20200923: disabling all legacy commands that keep
// spamming the console and otherwise have no effect
//sys_vgui("hammereditor_close .%x 1\n", (int)f);
}
void hammereditor_close(t_hammerfile *f, int ask)
......@@ -197,8 +199,8 @@ void hammereditor_close(t_hammerfile *f, int ask)
/* hack: deferring modal dialog creation in order to allow for
a message box redraw to happen -- LATER investigate */
clock_delay(f->f_editorclock, 0);
else
sys_vgui("hammereditor_close .%x 0\n", (int)f);
//else
//sys_vgui("hammereditor_close .%x 0\n", (int)f);
}
void hammereditor_append(t_hammerfile *f, char *contents)
......
......@@ -450,13 +450,13 @@ static void mknob_click(t_mknob *x, t_floatarg xpos, t_floatarg ypos,
if (x->x_gui.x_h<0)
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)mknob_motion_fullcircular, 0, xpos, ypos);
(t_glistmotionfn)mknob_motion_fullcircular, 0, 0, xpos, ypos);
else if (x->x_gui.x_h==0)
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)mknob_motion_circular, 0, xpos, ypos);
(t_glistmotionfn)mknob_motion_circular, 0, 0, xpos, ypos);
else
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)mknob_motion, 0, xpos, ypos);
(t_glistmotionfn)mknob_motion, 0, 0, xpos, ypos);
}
static int mknob_newclick(t_gobj *z, struct _glist *glist,
......
......@@ -1481,7 +1481,7 @@ static int pdp_colorgrid_click(t_gobj *z, struct _glist *glist,
pdp_colorgrid_output_current(x);
pdp_colorgrid_draw_update(x, glist);
glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)pdp_colorgrid_motion,
0, xpix, ypix);
0, 0, xpix, ypix);
}
return (1);
}
......
......@@ -518,7 +518,7 @@ static int breakpoints_newclick(t_breakpoints *x, struct _glist *glist,
breakpoints_next_doodle(x,glist,xpos,ypos);
glist_grab(x->w.glist, &x->x_obj.te_g, (t_glistmotionfn) breakpoints_motion,
(t_glistkeyfn) breakpoints_key, xpos, ypos);
(t_glistkeyfn) breakpoints_key, 0, xpos, ypos);
x->w.shift = shift;
breakpoints_followpointer(x,glist);
......@@ -544,7 +544,7 @@ static int breakpoints_newclick(t_breakpoints *x, struct _glist *glist,
breakpoints_next_doodle(x,glist,xpos,ypos);
glist_grab(x->w.glist, &x->x_obj.te_g, (t_glistmotionfn) breakpoints_motion,
(t_glistkeyfn) breakpoints_key, xpos, ypos);
(t_glistkeyfn) breakpoints_key, 0, xpos, ypos);
x->resizing = 0;
if (x->resizeable && (xpos > wxpos + x->w.width) &&
......
......@@ -670,7 +670,7 @@ static int audience_click(t_gobj *z, struct _glist *glist,
}
audience_draw_update(x, glist);
glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)audience_motion,
0, xpix, ypix);
0, 0, xpix, ypix);
}
return (1);
}
......
......@@ -880,7 +880,7 @@ static int cooled_click(t_gobj *z, struct _glist *glist,
x->x_alted = alt;
// activate motion callback
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)cooled_motion,
0, xpix, ypix );
0, 0, xpix, ypix );
// draw insertion line
if ( glist_isvisible( x->x_glist ) )
......
......@@ -510,7 +510,7 @@ static int grid_click(t_gobj *z, struct _glist *glist,
grid_output_current(x);
grid_draw_update(x, glist);
glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)grid_motion,
0, xpix, ypix);
0, 0, xpix, ypix);
}
return (1);
}
......
......@@ -640,7 +640,7 @@ static int playlist_click(t_gobj *z, struct _glist *glist,
}
x->x_glist = glist;
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)playlist_motion,
NULL, xpix, ypix );
NULL, NULL, xpix, ypix );
}
return (1);
}
......
......@@ -417,7 +417,7 @@ static int scratcher_click(t_gobj *z, struct _glist *glist,
{
// activate motion callback
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)scratcher_motion,
0, xpix, ypix );
0, 0, xpix, ypix );
x->x_readspeed=0.;
x->x_motioned = 1;
if ( x->x_showspeed )
......
......@@ -426,7 +426,7 @@ static int scrolllist_click(t_gobj *z, struct _glist *glist,
}
x->x_glist = glist;
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)scrolllist_motion,
NULL, xpix, ypix );
NULL, NULL, xpix, ypix );
}
return (1);
}
......
......@@ -1116,7 +1116,7 @@ static int sonogram_click(t_gobj *z, struct _glist *glist,
x->x_alted = alt;
// activate motion callback
glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)sonogram_motion,
0, xpix, ypix );
0, 0, xpix, ypix );
if ( shift && alt && (x->x_xstartcapture != x->x_xendcapture ) )
{
......
#N canvas 717 240 480 339 12;
#X abframe 1;
#N canvas 870 153 488 334 12;
#X obj 27 32 inlet;
#X obj 27 61 t f b b;
#X obj 27 140 expr 2*$f1*$f2+$f3;
#X obj 27 169 outlet;
#X obj 88 104 f \$1;
#X obj 150 104 f \$2;
#X obj 252 225 abinfo;
#X obj 252 254 print abinfo;
#X msg 219 188 name;
#X msg 264 188 instances;
#X msg 344 188 within;
#X obj 27 233 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X obj 27 257 f \$0;
#X obj 27 286 print;
#X text 94 61 private abstractions can have arguments...;
#X text 26 202 ... and have their own \$0;
#X obj 115 233 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X obj 115 257 ab bar;
#X floatatom 115 286 5 0 0 0 - - -, f 5;
#X text 218 98 abinfo yields the name of the abstraction \, the number
of its instances \, and the names of other private abstractions they
are contained in (if any), f 35;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 4 0;
#X connect 1 2 5 0;
#X connect 2 0 3 0;
#X connect 4 0 2 1;
#X connect 5 0 2 2;
#X connect 6 0 7 0;
#X connect 8 0 6 0;
#X connect 9 0 6 0;
#X connect 10 0 6 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 16 0 17 0;
#X connect 17 0 18 0;
#X abpush foo;
#N canvas 869 280 453 305 12;
#X obj 23 21 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X obj 23 45 ab bar;
#X floatatom 23 74 5 0 0 0 - - -, f 5;
#X text 81 45 <-- open "bar" and try abinfo "within"!;
#X obj 23 203 ab other_foobar;
#X text 20 233 Normally \, private abstractions such as [ab bar] above
have global scope \, so they are visible through the entire root patch
\, including all its subpatches and private abstractions., f 57;
#X text 20 109 Note that @foobar has local scope (indicated by the
"@" prefix) \, which includes all subpatches \, but doesn't cross (private)
abstraction boundaries. Thus the @foobar inside the other_foobar abstraction
below is a different @foobar than this one.;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X abpush @foobar;
#N canvas 1023 266 454 304 12;
#X obj 44 54 f \$0;
#X obj 44 83 outlet;
#X obj 44 25 inlet;
#X obj 147 63 abinfo;
#X obj 147 92 print abinfo;
#X msg 114 26 name;
#X msg 159 26 instances;
#X msg 239 26 within;
#X connect 0 0 1 0;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 5 0 3 0;
#X connect 6 0 3 0;
#X connect 7 0 3 0;
#X abpush bar foo @foobar;
#N canvas 788 330 452 303 12;
#X obj 22 24 ab @foobar;
#X text 112 24 <-- click here;
#X abpush other_foobar @foobar;
#N canvas 950 315 452 304 12;
#X text 16 31 Note that this instance of @foobar is different from
the one in the main patch!;
#X abpush other_foobar#@foobar other_foobar;
#X abframe 0;
#X floatatom 31 12 5 0 0 0 - - -, f 5;
#X floatatom 31 70 5 0 0 0 - - -, f 5;
#X obj 31 41 ab foo 3 2;
#X obj 267 89 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X obj 267 113 abdefs;
#X obj 267 142 print defs;
#X floatatom 30 159 5 0 0 0 - - -, f 5;
#X floatatom 30 217 5 0 0 0 - - -, f 5;
#X floatatom 128 71 5 0 0 0 - - -, f 5;
#X text 127 28 ... and cloned, f 10;
#X obj 128 99 pack f f;
#X msg 128 128 \$2 \$1;
#X obj 128 187 unpack f f;
#X floatatom 128 216 5 0 0 0 - - -, f 5;
#X floatatom 195 216 5 0 0 0 - - -, f 5;
#X text 29 117 ab's can be copied..., f 11;
#X obj 30 188 ab foo 3 5;
#X text 265 13 abdefs prints the list of all private abstractions contained
in a patch \, along with their instance counts, f 27;
#X text 22 266 CAVEAT: Private abstractions are identified by their
name. In contrast to one-offs \, editing their name may create a new
(and empty) abstraction!;
#X obj 128 158 abclone foo 4 5;
#X obj 181 73 hradio 15 0 0 4 empty empty empty 0 -8 0 10 #fcfcfc #000000
#000000 0;
#X obj 267 230 ab @foobar;
#N canvas 432 306 417 220 META 0;
#X text 13 47 LIBRARY internal;
#X text 13 1 KEYWORDS abstraction private;
#X text 13 24 DESCRIPTION creates a private abstraction;
#X text 13 70 AUTHOR Guillem Bartrina;
#X text 13 116 RELEASE_DATE 2020;
#X text 13 139 HELP_PATCH_AUTHORS Albert Gräf;
#X text 13 93 WEBSITE https://agraef.github.io/purr-data/;
#X restore 408 306 pd META;
#X text 265 174 a "local" abstraction which illustrates local scope
as well as abinfo "within"., f 27;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 6 0 16 0;
#X connect 8 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 19 0;
#X connect 12 0 13 0;
#X connect 12 1 14 0;
#X connect 16 0 7 0;
#X connect 19 0 12 0;
#X connect 20 0 10 1;
<!DOCTYPE html>
<html>
<head>
<link id="page_style" rel="stylesheet" type="text/css" href="css/default.css">
</head>
<body class="dialog_body prefs_body" style="overflow: hidden;">
<div class="container noselect prefs_container">
<table id="titlebar">
<tr>
<td style="width: 100%;">
<div id="titlebar_title">Abstractions</div>
</td>
<td id="titlebar_buttons_td">
<div class="titlebar_buttons">
<div id="titlebar_close_button" onclick="cancel();">&#215</div>
</div>
</td>
</tr>
</table>
<form>
<fieldset style="width: 90%">
<legend data-i18n="abstractions.private"></legend>
<strong data-i18n="abstractions.global"></strong>
<hr>
<table style="width: 90%; table-layout: fixed;">
</table>
<br>
<strong data-i18n="abstractions.local"></strong>
<hr>
<table style="width: 90%; table-layout: fixed;">
</table>
<br>
<button id="selectall_button" type="button" onClick="selectall()" data-i18n="[title]abstractions.selectall_tt" style="float: right;">
<span data-i18n="abstractions.selectall"></span>
</button>
</fieldset>
<!--
<hr>
<fieldset style="width: 90%; border: 2px solid grey">
<legend data-i18n="abstractions.filebased"></legend>
<i>NOT IMPLEMENTED</i>
<table style="width: 90%; table-layout: fixed;">
</table>
</fieldset>
<hr>
-->
<div class="submit_buttons">
<button id="delete_button" type="button" onClick="deleteselected()" data-i18n="[title]abstractions.delete_tt">
<span data-i18n="abstractions.delete"></span>
</button>
<button type="button" onClick="cancel()" data-i18n="[title]abstractions.close_tt">
<span data-i18n="abstractions.close"></span>
</button>
</div>
</form>
</div>
<script>
"use strict";
var gui = require("nw.gui");
var pdgui = require("./pdgui.js");
// For translations
var l = pdgui.get_local_string;
pdgui.skin.apply(window);
var pd_object_callback;
var canvas;
var deletequeue;
function selectall() {
var checkboxes = document.querySelectorAll('input[type="checkbox"]:not(:checked)');
for(var i = 0, n = checkboxes.length; i < n; i++) {
if(!checkboxes[i].checked)
{
checkboxes[i].click();
}
}
}
function deleteselected() {
pdgui.pdsend(pd_object_callback, "delabstractions", Array.from(deletequeue).join(" "));
cancel();
}
function cancel() {
pdgui.pdsend(pd_object_callback, "cancel");
}
function populate_form(attrs) {
var filebased_abs = attrs.filebased_abs,
private_abs = attrs.private_abs,
i,
zero = 0;
canvas = attrs.canvas;
deletequeue = new Set();
var tables = document.querySelectorAll("table"),
privateglobal_table = tables[1],
privatelocal_table = tables[2];
//filebased_table = tables[2]
/*
for(i = 0; i < filebased_abs.length; i += 2)
{
var row = document.createElement("tr");
cell1 = document.createElement("td"),
cell2 = document.createElement("td"),
cell3 = document.createElement("td");
cell1.textContent = filebased_abs[i];
cell1.style.setProperty("width", "70%");
cell2.textContent = filebased_abs[i+1];
cell2.style.setProperty("width", "20%");
row.appendChild(cell1);
row.appendChild(cell2);
row.appendChild(cell3);
filebased_table.appendChild(row);
}
*/
for(i = 0; i < private_abs.length; i += 2)
{
var row = document.createElement("tr"),
cell1 = document.createElement("td"),
cell2 = document.createElement("td"),
cell3 = document.createElement("td");
cell1.textContent = private_abs[i];
cell1.style.setProperty("width", "70%");
cell2.textContent = private_abs[i+1];
cell2.style.setProperty("width", "20%");
if(private_abs[i+1] === 0)
{
let input_elem = document.createElement("input"),
j = i;
input_elem.type = "checkbox";
input_elem.style.setProperty("max-height", "10px");
input_elem.style.setProperty("top", "0px");
input_elem.onchange = function() {
if(input_elem.checked) {
deletequeue.add(private_abs[j]);
} else {
deletequeue.delete(private_abs[j]);
}
get_elem("delete_button").disabled = (deletequeue.size === 0);
};
cell3.appendChild(input_elem);
zero++;
}
row.appendChild(cell1);
row.appendChild(cell2);
row.appendChild(cell3);
if(private_abs[i][0] === '@') {
privatelocal_table.appendChild(row);
} else {
privateglobal_table.appendChild(row);
}
}
get_elem("selectall_button").disabled = (zero === 0);
get_elem("delete_button").disabled = true;
}
// This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it
// we can create the menu and register event callbacks
function register_window_id(gfxstub, attrs) {
pd_object_callback = gfxstub;
add_events(gfxstub);
// not sure that we need this for properties windows
//pdgui.canvas_map(gfxstub);
translate_form();
populate_form(attrs);
// We don't turn on rendering of the "container" div until
// We've finished displaying all the spans and populating the
// labels and form elements. That makes it more efficient and
// snappier, at least on older machines.
document.getElementsByClassName("container")[0].style.setProperty("display", "inline");
gui.Window.get().setResizable(false);
}
function get_elem(name) {
return document.getElementById(name);
}
// Stop-gap translator
function translate_form() {
var elements = document.querySelectorAll("[data-i18n]"),
data,
i;
for (i = 0; i < elements.length; i++) {
data = elements[i].dataset.i18n;
if (data.slice(0, 7) === "[title]") {
elements[i].title = l(data.slice(7));
} else {
elements[i].textContent = l(data);
}
}
}
function add_events(name) {
gui.Window.get().on("close", function () {
cancel();
});
pdgui.dialog_bindings(name);
}
</script>
</body>
</html>
......@@ -149,7 +149,8 @@ function parse_attrs(attrs) {
if (token.length > 1) {
elem.type = token[token.length - 1];
if (elem.type !== "symbol" &&
elem.type !== "toggle") {
elem.type !== "toggle" &&
elem.type !== "hidden") {
// no suffix defaults to "number"
elem.type = "number";
} else {
......@@ -218,6 +219,7 @@ function get_input_type(t) {
return t === "symbol" ? "text" :
t === "number" ? "text" :
t === "toggle" ? "checkbox":
t === "hidden" ? "hidden":
"text";
}
......
......@@ -291,6 +291,27 @@
<fieldset>
<legend data-i18n="iem.prop.heading.colors"></legend>
<table class="draw_style prop hidden" style="margin-bottom: 7px;">
<tr>
<td>
<label data-i18n="[title]iem.prop.drawstyle_tt">
<span data-i18n="iem.prop.drawstyle"
style="margin-right: 6px;"></span>
</label>
</td>
<td data-i18n="[title]iem.prop.drawstyle_tt">
<select name="draw_style"
onchange="update_attr(this, true);"
style="width: 14em;">
<option value="0">draw everything (default)</option>
<option value="1">draw frame only</option>
<option value="2">draw triangle only</option>
<option value="3">draw number only</option>
</select>
</td>
<td>
</table>
<div class="background_color prop hidden">
<label data-i18n="[title]iem.prop.bgcolor_tt">
<input type="color" name="background_color"
......@@ -512,6 +533,8 @@ function send_params(attrs, create_undo_point) {
var slot18 = attrs.steady_on_click ? +attrs.steady_on_click : 0;
var draw_style = attrs.draw_style ? +attrs.draw_style : 0;
pdgui.pdsend(pd_object_callback, "dialog",
width, height,