diff --git a/pd/src/g_canvas.h b/pd/src/g_canvas.h index 964d8fab820992ae09b20e49af661c5d8f472645..5c340e103a43c0a4898121fcfb791efd26211e43 100644 --- a/pd/src/g_canvas.h +++ b/pd/src/g_canvas.h @@ -237,6 +237,8 @@ struct _glist #define gl_gobj gl_obj.te_g #define gl_pd gl_gobj.g_pd +typedef void (*t_canvas_iterator)(t_canvas *x, void *data); + /*-------------------universal preset stuff---------------------*/ // for the universal preset_node ability (see g_editor.c doconnect/disconnect functions) // this is where all the classes capable of being controlled via preset should be defined diff --git a/pd/src/g_clone.c b/pd/src/g_clone.c index 2529161e6de5da95ad0291e413b39d86a16018be..c06f8dba7fb293b955382fa085feb4137933ec64 100644 --- a/pd/src/g_clone.c +++ b/pd/src/g_clone.c @@ -65,6 +65,16 @@ typedef struct _clone int x_suppressvoice; /* suppress voice number as $1 arg */ } t_clone; +/* the given 'it' function is executed over each of the underlying canvases + (they are passed as first parameter). 'data' is passed as second argument */ +void clone_iterate(t_pd *z, t_canvas_iterator it, void* data) +{ + t_clone *x = (t_clone *)z; + int i; + for(i = 0; i < x->x_n; i++) + it(x->x_vec[i].c_gl, data); +} + int clone_match(t_pd *z, t_symbol *name, t_symbol *dir) { t_clone *x = (t_clone *)z;