[PD-cvs] pd/src desire.c, 1.1.2.207, 1.1.2.208 desire.h, 1.1.2.44, 1.1.2.45
Mathieu Bouchard
matju at users.sourceforge.net
Tue Nov 28 02:54:02 CET 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6069
Modified Files:
Tag: devel_0_39
desire.c desire.h
Log Message:
more PD_PLUSPLUS_FACE
Index: desire.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v
retrieving revision 1.1.2.44
retrieving revision 1.1.2.45
diff -C2 -d -r1.1.2.44 -r1.1.2.45
*** desire.h 23 Nov 2006 20:06:52 -0000 1.1.2.44
--- desire.h 28 Nov 2006 01:54:00 -0000 1.1.2.45
***************
*** 139,144 ****
--- 139,148 ----
/* the t_canvas structure, which describes a list of elements that live on an area of a window.*/
+ #ifdef PD_PLUSPLUS_FACE
+ struct _glist : t_object {
+ #else
struct _glist {
t_object gl_obj; /* header in case we're a canvas */
+ #endif
t_gobj *list; /* the actual data */
struct _gstub *stub; /* safe pointer handler */
***************
*** 205,210 ****
--- 209,218 ----
};
+ #ifdef PD_PLUSPLUS_FACE
+ struct _garray : t_gobj {
+ #else
struct _garray {
t_gobj x_gobj;
+ #endif
t_scalar *scalar; /* scalar "containing" the array */
t_canvas *canvas; /* containing canvas */
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.207
retrieving revision 1.1.2.208
diff -C2 -d -r1.1.2.207 -r1.1.2.208
*** desire.c 28 Nov 2006 01:17:55 -0000 1.1.2.207
--- desire.c 28 Nov 2006 01:53:58 -0000 1.1.2.208
***************
*** 507,511 ****
char buf[40];
canvas_init(x);
! x->gl_obj.te_type = T_OBJECT;
if (!owner) canvas_addtolist(x);
/* toplevel vs subwindow */
--- 507,511 ----
char buf[40];
canvas_init(x);
! x->te_type = T_OBJECT;
if (!owner) canvas_addtolist(x);
/* toplevel vs subwindow */
***************
*** 582,586 ****
t_canvas *x = (t_canvas *)pd_new(canvas_class);
canvas_init(x);
! x->gl_obj.te_type = T_OBJECT;
if (!*sym->s_name) {
char buf[40];
--- 582,586 ----
t_canvas *x = (t_canvas *)pd_new(canvas_class);
canvas_init(x);
! x->te_type = T_OBJECT;
if (!*sym->s_name) {
char buf[40];
***************
*** 602,607 ****
}
x->name = sym;
! x->x1 = x1; x->y1 = y1; x->gl_obj.te_xpix = (short)px1; x->pixwidth = (int)(px2-px1);
! x->x2 = x2; x->y2 = y2; x->gl_obj.te_ypix = (short)py1; x->pixheight = (int)(py2-py1);
x->font = (canvas_getcurrent() ? canvas_getcurrent()->font : sys_defaultfont);
x->screenx1 = x->screeny1 = 0; x->screenx2 = 450; x->screeny2 = 300;
--- 602,607 ----
}
x->name = sym;
! x->x1 = x1; x->y1 = y1; x->te_xpix = (short)px1; x->pixwidth = (int)(px2-px1);
! x->x2 = x2; x->y2 = y2; x->te_ypix = (short)py1; x->pixheight = (int)(py2-py1);
x->font = (canvas_getcurrent() ? canvas_getcurrent()->font : sys_defaultfont);
x->screenx1 = x->screeny1 = 0; x->screenx2 = 450; x->screeny2 = 300;
***************
*** 610,617 ****
x->isgraph = 1;
x->goprect = 0;
! x->gl_obj.te_binbuf = binbuf_new();
! binbuf_addv(x->gl_obj.te_binbuf, "s", gensym("graph"));
if (!menu) pd_pushsym(x);
! canvas_add(g, (t_gobj *)x);
return x;
}
--- 610,617 ----
x->isgraph = 1;
x->goprect = 0;
! x->te_binbuf = binbuf_new();
! binbuf_addv(x->te_binbuf, "s", gensym("graph"));
if (!menu) pd_pushsym(x);
! canvas_add(g,x);
return x;
}
***************
*** 630,635 ****
canvas_each(y,x) gobj_changed(y,0);
if (x->owner && canvas_isvisible(x->owner)) {
! graph_vis((t_gobj *)x, 0);
! graph_vis((t_gobj *)x, 1);
}
}
--- 630,635 ----
canvas_each(y,x) gobj_changed(y,0);
if (x->owner && canvas_isvisible(x->owner)) {
! graph_vis(x,0);
! graph_vis(x,1);
}
}
***************
*** 674,678 ****
void canvas_map(t_canvas *x, t_floatarg f) {
if (f!=0 && !canvas_isvisible(x)) {
! gobj_subscribe((t_gobj *)x,(t_gobj *)manager);
canvas_each(y,x) gobj_changed(y,0);
gobj_changed(x,0);
--- 674,678 ----
void canvas_map(t_canvas *x, t_floatarg f) {
if (f!=0 && !canvas_isvisible(x)) {
! gobj_subscribe(x,manager);
canvas_each(y,x) gobj_changed(y,0);
gobj_changed(x,0);
***************
*** 804,808 ****
t_canvas *x2 = (t_canvas *)z;
x->owner = x2;
! canvas_objfor(x2, &x->gl_obj, argc, argv);
}
}
--- 804,808 ----
t_canvas *x2 = (t_canvas *)z;
x->owner = x2;
! canvas_objfor(x2, x, argc, argv);
}
}
***************
*** 929,934 ****
/* return true if the "canvas" object is a "table". */
int canvas_istable(t_canvas *x) {
! t_atom *argv = x->gl_obj.te_binbuf ? binbuf_getvec( x->gl_obj.te_binbuf) : 0;
! int argc = x->gl_obj.te_binbuf ? binbuf_getnatom(x->gl_obj.te_binbuf) : 0;
return argc && argv[0].a_type == A_SYMBOL && argv[0].a_w.w_symbol == gensym("table");
}
--- 929,934 ----
/* return true if the "canvas" object is a "table". */
int canvas_istable(t_canvas *x) {
! t_atom *argv = x->te_binbuf ? binbuf_getvec( x->te_binbuf) : 0;
! int argc = x->te_binbuf ? binbuf_getnatom(x->te_binbuf) : 0;
return argc && argv[0].a_type == A_SYMBOL && argv[0].a_w.w_symbol == gensym("table");
}
***************
*** 937,942 ****
object. This is true for abstractions but also for "table"s... */
static int canvas_showtext(t_canvas *x) {
! t_atom *argv = x->gl_obj.te_binbuf? binbuf_getvec( x->gl_obj.te_binbuf) : 0;
! int argc = x->gl_obj.te_binbuf? binbuf_getnatom(x->gl_obj.te_binbuf) : 0;
int isarray = argc && argv[0].a_type == A_SYMBOL && argv[0].a_w.w_symbol == gensym("graph");
return !isarray;
--- 937,942 ----
object. This is true for abstractions but also for "table"s... */
static int canvas_showtext(t_canvas *x) {
! t_atom *argv = x->te_binbuf? binbuf_getvec( x->te_binbuf) : 0;
! int argc = x->te_binbuf? binbuf_getnatom(x->te_binbuf) : 0;
int isarray = argc && argv[0].a_type == A_SYMBOL && argv[0].a_w.w_symbol == gensym("graph");
return !isarray;
***************
*** 972,978 ****
/* create a new "DSP graph" object to use in sorting this canvas.
If we aren't toplevel, there are already other dspcontexts around. */
! dc = ugen_start_graph(toplevel, sp,
! obj_nsiginlets(&x->gl_obj),
! obj_nsigoutlets(&x->gl_obj));
/* find all the "dsp" boxes and add them to the graph */
--- 972,976 ----
/* create a new "DSP graph" object to use in sorting this canvas.
If we aren't toplevel, there are already other dspcontexts around. */
! dc = ugen_start_graph(toplevel, sp, obj_nsiginlets(x), obj_nsigoutlets(x));
/* find all the "dsp" boxes and add them to the graph */
***************
*** 1538,1542 ****
x->saveit = saveit;
x->listviewing = 0;
! canvas_add(gl, &x->x_gobj);
x->canvas = gl;
return x;
--- 1536,1540 ----
x->saveit = saveit;
x->listviewing = 0;
! canvas_add(gl,x);
x->canvas = gl;
return x;
***************
*** 1587,1591 ****
t_array *array = garray_getarray(x);
t_canvas *gl = x->canvas;
! if (gl->list == &x->x_gobj && !x->x_gobj.g_next) {
vmess((t_pd *)gl, gensym("bounds"), "ffff", 0., gl->y1,
(double)(style == PLOTSTYLE_POINTS || n == 1 ? n : n-1), gl->y2);
--- 1585,1589 ----
t_array *array = garray_getarray(x);
t_canvas *gl = x->canvas;
! if (gl->list == x && !x->g_next) {
vmess((t_pd *)gl, gensym("bounds"), "ffff", 0., gl->y1,
(double)(style == PLOTSTYLE_POINTS || n == 1 ? n : n-1), gl->y2);
***************
*** 1644,1648 ****
static t_canvas *canvas_findgraph(t_canvas *x) {
t_gobj *y = 0;
! canvas_each(z,x) if (pd_class(&z->_class) == canvas_class && ((t_canvas *)z)->isgraph) y = z;
return (t_canvas *)y;
}
--- 1642,1646 ----
static t_canvas *canvas_findgraph(t_canvas *x) {
t_gobj *y = 0;
! canvas_each(z,x) if (z->_class==canvas_class && ((t_canvas *)z)->isgraph) y = z;
return (t_canvas *)y;
}
***************
*** 1674,1678 ****
template_findbyname(x->scalar->sc_template), gensym("style"), x->scalar->sc_vec, 1);
if (deleteit != 0) {
! canvas_delete(x->canvas, &x->x_gobj);
} else {
int size;
--- 1672,1676 ----
template_findbyname(x->scalar->sc_template), gensym("style"), x->scalar->sc_vec, 1);
if (deleteit != 0) {
! canvas_delete(x->canvas,x);
} else {
int size;
***************
*** 2351,2359 ****
static float gobj_getxforsort(t_gobj *g) {
! if (pd_class(&g->_class) == scalar_class) {
! float x1, y1;
! scalar_getbasexy((t_scalar *)g, &x1, &y1);
! return x1;
! } else return 0;
}
--- 2349,2356 ----
static float gobj_getxforsort(t_gobj *g) {
! if (g->_class!=scalar_class) return 0;
! float x1, y1;
! scalar_getbasexy((t_scalar *)g, &x1, &y1);
! return x1;
}
***************
*** 2406,2415 ****
static t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *s, t_symbol* h) {
! t_inlet *ip = inlet_new(&x->gl_obj, who, s, 0); inlet_settip(ip,h);
if (!x->loading) canvas_resortinlets(x);
gobj_changed(x,0); return ip;
}
static t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *s) {
! t_outlet *op = outlet_new(&x->gl_obj, s);
if (!x->loading) canvas_resortoutlets(x);
gobj_changed(x,0); return op;
--- 2403,2412 ----
static t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *s, t_symbol* h) {
! t_inlet *ip = inlet_new(x,who,s,0); inlet_settip(ip,h);
if (!x->loading) canvas_resortinlets(x);
gobj_changed(x,0); return ip;
}
static t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *s) {
! t_outlet *op = outlet_new(x,s);
if (!x->loading) canvas_resortoutlets(x);
gobj_changed(x,0); return op;
***************
*** 2417,2425 ****
static void canvas_rminlet(t_canvas *x, t_inlet *ip) {
! if (x->owner) canvas_deletelinesforio(x->owner, &x->gl_obj, ip, 0);
inlet_free(ip); gobj_changed(x,0);
}
static void canvas_rmoutlet(t_canvas *x, t_outlet *op) {
! if (x->owner) canvas_deletelinesforio(x->owner, &x->gl_obj, 0, op);
outlet_free(op); gobj_changed(x,0);
}
--- 2414,2422 ----
static void canvas_rminlet(t_canvas *x, t_inlet *ip) {
! if (x->owner) canvas_deletelinesforio(x->owner,x,ip,0);
inlet_free(ip); gobj_changed(x,0);
}
static void canvas_rmoutlet(t_canvas *x, t_outlet *op) {
! if (x->owner) canvas_deletelinesforio(x->owner,x,0,op);
outlet_free(op); gobj_changed(x,0);
}
***************
*** 2433,2440 ****
int n=0, j, xmax, x1;
t_gobj *y, **vec, **vp, **maxp;
! canvas_each(y,x) if (pd_class(&y->_class) == vinlet_class) n++;
if (n<2) return;
vp = vec = (t_gobj **)getbytes(n*sizeof(*vec));
! canvas_each(y,x) if (pd_class(&y->_class) == vinlet_class) *vp++ = y;
for (int i=n; i--;) {
t_inlet *ip;
--- 2430,2437 ----
int n=0, j, xmax, x1;
t_gobj *y, **vec, **vp, **maxp;
! canvas_each(y,x) if (y->_class==vinlet_class) n++;
if (n<2) return;
vp = vec = (t_gobj **)getbytes(n*sizeof(*vec));
! canvas_each(y,x) if (y->_class==vinlet_class) *vp++ = y;
for (int i=n; i--;) {
t_inlet *ip;
***************
*** 2447,2451 ****
y = *maxp; *maxp = 0;
ip = vinlet_getit(&y->_class);
! obj_moveinletfirst(&x->gl_obj, ip);
}
freebytes(vec, n*sizeof(*vec));
--- 2444,2448 ----
y = *maxp; *maxp = 0;
ip = vinlet_getit(&y->_class);
! obj_moveinletfirst(x,ip);
}
freebytes(vec, n*sizeof(*vec));
***************
*** 2454,2461 ****
int n=0, j, xmax, x1;
t_gobj *y, **vec, **vp, **maxp;
! canvas_each(y,x) if (pd_class(&y->_class) == voutlet_class) n++;
if (n<2) return;
vp = vec = (t_gobj **)getbytes(n*sizeof(*vec));
! canvas_each(y,x) if (pd_class(&y->_class) == voutlet_class) *vp++ = y;
for (int i=n; i--;) {
t_outlet *ip;
--- 2451,2458 ----
int n=0, j, xmax, x1;
t_gobj *y, **vec, **vp, **maxp;
! canvas_each(y,x) if (y->_class==voutlet_class) n++;
if (n<2) return;
vp = vec = (t_gobj **)getbytes(n*sizeof(*vec));
! canvas_each(y,x) if (y->_class==voutlet_class) *vp++ = y;
for (int i=n; i--;) {
t_outlet *ip;
***************
*** 2468,2472 ****
y = *maxp; *maxp = 0;
ip = voutlet_getit(&y->_class);
! obj_moveoutletfirst(&x->gl_obj, ip);
}
freebytes(vec, n*sizeof(*vec));
--- 2465,2469 ----
y = *maxp; *maxp = 0;
ip = voutlet_getit(&y->_class);
! obj_moveoutletfirst(x,ip);
}
freebytes(vec, n*sizeof(*vec));
***************
*** 2516,2520 ****
if (!x->isgraph) return x->x1 + width * xpix;
if (x->havewindow) return x->x1 + width * xpix / (x->screenx2-x->screenx1);
! graph_graphrect((t_gobj *)x, x->owner, &x1, &y1, &x2, &y2);
return x->x1 + width * (xpix-x1) / (x2-x1);
}
--- 2513,2517 ----
if (!x->isgraph) return x->x1 + width * xpix;
if (x->havewindow) return x->x1 + width * xpix / (x->screenx2-x->screenx1);
! graph_graphrect(x, x->owner, &x1, &y1, &x2, &y2);
return x->x1 + width * (xpix-x1) / (x2-x1);
}
***************
*** 2523,2527 ****
if (!x->isgraph) return x->y1 + height * ypix;
if (x->havewindow) return x->y1 + height * ypix / (x->screeny2-x->screeny1);
! graph_graphrect((t_gobj *)x, x->owner, &x1, &y1, &x2, &y2);
return x->y1 + height * (ypix-y1) / (y2-y1);
}
--- 2520,2524 ----
if (!x->isgraph) return x->y1 + height * ypix;
if (x->havewindow) return x->y1 + height * ypix / (x->screeny2-x->screeny1);
! graph_graphrect(x, x->owner, &x1, &y1, &x2, &y2);
return x->y1 + height * (ypix-y1) / (y2-y1);
}
***************
*** 2532,2536 ****
if (!x->isgraph) return (int)((xval-x->x1)/width);
if (x->havewindow) return (int)((x->screenx2-x->screenx1) * (xval-x->x1) / width);
! graph_graphrect((t_gobj *)x, x->owner, &x1, &y1, &x2, &y2);
return (int)(x1 + (x2-x1) * (xval-x->x1) / width);
}
--- 2529,2533 ----
if (!x->isgraph) return (int)((xval-x->x1)/width);
if (x->havewindow) return (int)((x->screenx2-x->screenx1) * (xval-x->x1) / width);
! graph_graphrect(x, x->owner, &x1, &y1, &x2, &y2);
return (int)(x1 + (x2-x1) * (xval-x->x1) / width);
}
***************
*** 2539,2543 ****
if (!x->isgraph) return (int)((yval-x->y1)/height);
if (x->havewindow) return (int)((x->screeny2-x->screeny1) * (yval-x->y1) / height);
! graph_graphrect((t_gobj *)x, x->owner, &x1, &y1, &x2, &y2);
return (int)(y1 + (y2-y1) * (yval-x->y1) / height);
}
--- 2536,2540 ----
if (!x->isgraph) return (int)((yval-x->y1)/height);
if (x->havewindow) return (int)((x->screeny2-x->screeny1) * (yval-x->y1) / height);
! graph_graphrect(x, x->owner, &x1, &y1, &x2, &y2);
return (int)(y1 + (y2-y1) * (yval-x->y1) / height);
}
***************
*** 2552,2556 ****
float width = canvas->x2-canvas->x1;
if (canvas->havewindow || !canvas->isgraph) return x->te_xpix;
! if (canvas->goprect) return canvas->gl_obj.te_xpix + x->te_xpix - canvas->xmargin;
return canvas_xtopixels(canvas, canvas->x1 + width * x->te_xpix / (canvas->screenx2-canvas->screenx1));
}
--- 2549,2553 ----
float width = canvas->x2-canvas->x1;
if (canvas->havewindow || !canvas->isgraph) return x->te_xpix;
! if (canvas->goprect) return canvas->te_xpix + x->te_xpix - canvas->xmargin;
return canvas_xtopixels(canvas, canvas->x1 + width * x->te_xpix / (canvas->screenx2-canvas->screenx1));
}
***************
*** 2558,2562 ****
float height = canvas->y2-canvas->y1;
if (canvas->havewindow || !canvas->isgraph) return x->te_ypix;
! if (canvas->goprect) return canvas->gl_obj.te_ypix + x->te_ypix - canvas->ymargin;
return canvas_ytopixels(canvas, canvas->y1 + height* x->te_ypix / (canvas->screeny2-canvas->screeny1));
}
--- 2555,2559 ----
float height = canvas->y2-canvas->y1;
if (canvas->havewindow || !canvas->isgraph) return x->te_ypix;
! if (canvas->goprect) return canvas->te_ypix + x->te_ypix - canvas->ymargin;
return canvas_ytopixels(canvas, canvas->y1 + height* x->te_ypix / (canvas->screeny2-canvas->screeny1));
}
***************
*** 2666,2671 ****
static void graph_graphrect(t_gobj *z, t_canvas *canvas, int *xp1, int *yp1, int *xp2, int *yp2) {
t_canvas *x = (t_canvas *)z;
! *xp1 = text_xpix(&x->gl_obj, canvas); *xp2 = *xp1+x->pixwidth;
! *yp1 = text_ypix(&x->gl_obj, canvas); *yp2 = *yp1+x->pixheight;
}
--- 2663,2668 ----
static void graph_graphrect(t_gobj *z, t_canvas *canvas, int *xp1, int *yp1, int *xp2, int *yp2) {
t_canvas *x = (t_canvas *)z;
! *xp1 = text_xpix(x,canvas); *xp2 = *xp1+x->pixwidth;
! *yp1 = text_ypix(x,canvas); *yp2 = *yp1+x->pixheight;
}
***************
*** 2684,2688 ****
graph_lastypix = newypix;
// verify that the array is OK
! if (!a || pd_class((t_pd *)a) != garray_class) return;
if (!garray_getfloatarray(a, &nelem, &vec)) return;
if (oldx < 0) oldx = 0; else if (oldx >= nelem) oldx = nelem - 1;
--- 2681,2685 ----
graph_lastypix = newypix;
// verify that the array is OK
! if (!a || a->_class != garray_class) return;
if (!garray_getfloatarray(a, &nelem, &vec)) return;
if (oldx < 0) oldx = 0; else if (oldx >= nelem) oldx = nelem - 1;
***************
*** 3052,3056 ****
static void canvas_writelist(t_gobj *y, t_binbuf *b) {
for (; y; y = y->g_next)
! if (pd_class(&y->_class) == scalar_class)
canvas_writescalar(((t_scalar *)y)->sc_template, ((t_scalar *)y)->sc_vec, b, 0);
}
--- 3049,3053 ----
static void canvas_writelist(t_gobj *y, t_binbuf *b) {
for (; y; y = y->g_next)
! if (y->_class == scalar_class)
canvas_writescalar(((t_scalar *)y)->sc_template, ((t_scalar *)y)->sc_vec, b, 0);
}
***************
*** 3081,3085 ****
static void canvas_addtemplatesforlist(t_gobj *y, int *p_ntemplates, t_symbol ***p_templatevec) {
for (; y; y = y->g_next)
! if (pd_class(&y->_class) == scalar_class)
canvas_addtemplatesforscalar(((t_scalar *)y)->sc_template,
((t_scalar *)y)->sc_vec, p_ntemplates, p_templatevec);
--- 3078,3082 ----
static void canvas_addtemplatesforlist(t_gobj *y, int *p_ntemplates, t_symbol ***p_templatevec) {
for (; y; y = y->g_next)
! if (y->_class == scalar_class)
canvas_addtemplatesforscalar(((t_scalar *)y)->sc_template,
((t_scalar *)y)->sc_vec, p_ntemplates, p_templatevec);
***************
*** 3090,3094 ****
int ntemplates = 0;
t_binbuf *b = binbuf_new();
! canvas_each(y,x) if ((pd_class(&y->_class) == scalar_class) && wholething) {
t_scalar *s = (t_scalar *)y;
canvas_addtemplatesforscalar(s->sc_template, s->sc_vec, &ntemplates, &templatevec);
--- 3087,3091 ----
int ntemplates = 0;
t_binbuf *b = binbuf_new();
! canvas_each(y,x) if (y->_class==scalar_class && wholething) {
t_scalar *s = (t_scalar *)y;
canvas_addtemplatesforscalar(s->sc_template, s->sc_vec, &ntemplates, &templatevec);
***************
*** 3118,3122 ****
/* now write out the objects themselves */
canvas_each(y,x)
! if (pd_class(&y->_class) == scalar_class && wholething)
canvas_writescalar(((t_scalar *)y)->sc_template, ((t_scalar *)y)->sc_vec, b, 0);
return b;
--- 3115,3119 ----
/* now write out the objects themselves */
canvas_each(y,x)
! if (y->_class==scalar_class && wholething)
canvas_writescalar(((t_scalar *)y)->sc_template, ((t_scalar *)y)->sc_vec, b, 0);
return b;
***************
*** 3183,3190 ****
t_symbol ***templatevecp, int wholething) {
canvas_each(y,x) {
! if (pd_class(&y->_class) == scalar_class && wholething)
canvas_addtemplatesforscalar(((t_scalar *)y)->sc_template,
((t_scalar *)y)->sc_vec, ntemplatesp, templatevecp);
! else if (pd_class(&y->_class) == canvas_class && wholething)
canvas_collecttemplatesfor((t_canvas *)y, ntemplatesp, templatevecp, 1);
}
--- 3180,3187 ----
t_symbol ***templatevecp, int wholething) {
canvas_each(y,x) {
! if (y->_class==scalar_class && wholething)
canvas_addtemplatesforscalar(((t_scalar *)y)->sc_template,
((t_scalar *)y)->sc_vec, ntemplatesp, templatevecp);
! else if (y->_class==canvas_class && wholething)
canvas_collecttemplatesfor((t_canvas *)y, ntemplatesp, templatevecp, 1);
}
***************
*** 4203,4207 ****
static void template_conformcanvas(t_template *tfrom, t_template *tto, int *conformaction, t_canvas *canvas) {
canvas_each(g,canvas) {
! t_class *c = pd_class(&g->_class);
if (c==scalar_class)
g = (t_gobj *)template_conformscalar(tfrom, tto, conformaction, canvas, (t_scalar *)g);
--- 4200,4204 ----
static void template_conformcanvas(t_template *tfrom, t_template *tto, int *conformaction, t_canvas *canvas) {
canvas_each(g,canvas) {
! t_class *c = g->_class;
if (c==scalar_class)
g = (t_gobj *)template_conformscalar(tfrom, tto, conformaction, canvas, (t_scalar *)g);
***************
*** 5428,5432 ****
if (!gobj) gobj = canvas->list;
else gobj = gobj->g_next;
! while (gobj && (pd_class(&gobj->_class) != scalar_class || wantselected)) gobj = gobj->g_next;
if (gobj) {
t_typedout *to = x->typedout;
--- 5425,5429 ----
if (!gobj) gobj = canvas->list;
else gobj = gobj->g_next;
! while (gobj && (gobj->_class != scalar_class || wantselected)) gobj = gobj->g_next;
if (gobj) {
t_typedout *to = x->typedout;
***************
*** 6106,6111 ****
x->te_type = T_OBJECT;
canvas_add(gl,x);
! if (pd_class(&x->ob_pd) == vinlet_class) canvas_resortinlets(canvas_getcanvas(gl));
! if (pd_class(&x->ob_pd) == voutlet_class) canvas_resortoutlets(canvas_getcanvas(gl));
pd_popsym(gl);
}
--- 6103,6108 ----
x->te_type = T_OBJECT;
canvas_add(gl,x);
! if (x->_class== vinlet_class) canvas_resortinlets(canvas_getcanvas(gl));
! if (x->_class==voutlet_class) canvas_resortoutlets(canvas_getcanvas(gl));
pd_popsym(gl);
}
***************
*** 6331,6335 ****
if (x->te_type == T_OBJECT) {
if (zgetfn(&x->te_pd, gensym("saveto")) &&
! !(pd_class(&x->te_pd)==canvas_class && (canvas_isabstraction(c) || canvas_istable(c)))) {
mess1(&x->te_pd, gensym("saveto"), b);
binbuf_addv(b, "ssii", gensym("#X"), gensym("restore"), (t_int)x->te_xpix, (t_int)x->te_ypix);
--- 6328,6332 ----
if (x->te_type == T_OBJECT) {
if (zgetfn(&x->te_pd, gensym("saveto")) &&
! !(x->_class==canvas_class && (canvas_isabstraction(c) || canvas_istable(c)))) {
mess1(&x->te_pd, gensym("saveto"), b);
binbuf_addv(b, "ssii", gensym("#X"), gensym("restore"), (t_int)x->te_xpix, (t_int)x->te_ypix);
More information about the Pd-cvs
mailing list