int libpd_getdollarzero(void *x) { sys_lock(); pd_pushsym((t_pd *)x); int dzero = canvas_getdollarzero(); pd_popsym((t_pd *)x); sys_unlock(); return dzero; }
/* LATER find a better way */ int hammerfile_ispasting(t_hammerfile *f) { int result = 0; t_canvas *cv = f->f_canvas; if (!cv->gl_loading) { t_pd *z = s__X.s_thing; if (z == (t_pd *)cv) { pd_popsym(z); if (s__X.s_thing == (t_pd *)cv) result = 1; pd_pushsym(z); } else if (z) result = 1; } #if 0 if (result) post("pasting"); #endif return (result); }
static void *table_donew(t_symbol *s, int size, int flags, int xpix, int ypix) { t_atom a[9]; t_glist *gl; t_canvas *x, *z = canvas_getcurrent(); if (s == &s_) { char tabname[255]; t_symbol *t = gensym("table"); sprintf(tabname, "%s%d", t->s_name, tabcount++); s = gensym(tabname); } if (size < 1) size = 100; SETFLOAT(a, 0); SETFLOAT(a+1, 50); SETFLOAT(a+2, xpix + 100); SETFLOAT(a+3, ypix + 100); SETSYMBOL(a+4, s); SETFLOAT(a+5, 0); x = canvas_new(0, 0, 6, a); x->gl_owner = z; /* create a graph for the table */ gl = glist_addglist((t_glist*)x, &s_, 0, -1, (size > 1 ? size-1 : 1), 1, 50, ypix+50, xpix+50, 50); graph_array(gl, s, &s_float, size, flags); pd_this->pd_newest = &x->gl_pd; /* mimic action of canvas_pop() */ pd_popsym(&x->gl_pd); x->gl_loading = 0; return (x); }