Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13668
Modified Files: Tag: desiredata desire.c Log Message: added pd_new2, pd_new3, manager_anything
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.5 retrieving revision 1.1.2.217.2.6 diff -C2 -d -r1.1.2.217.2.5 -r1.1.2.217.2.6 *** desire.c 1 Dec 2006 21:00:00 -0000 1.1.2.217.2.5 --- desire.c 2 Dec 2006 03:06:57 -0000 1.1.2.217.2.6 *************** *** 83,86 **** --- 83,91 ---- t_symbol *s_empty, *s_pd, *s_Pd;
+ struct _binbuf { + int b_n; + t_atom *b_vec; + }; + //-------------------------------------------------------------------------- // t_appendix: an extension to t_gobj made by matju so that *************** *** 253,264 **** // update manager:
! struct t_manager : t_gobj { t_queue *q; t_clock *clock; unsigned short serial; /* of objects created by the client */ };
static t_class *manager_class; ! static t_manager *manager;
void manager_call (void *foo) { --- 258,271 ---- // update manager:
! struct t_manager : t_text { t_queue *q; t_clock *clock; unsigned short serial; /* of objects created by the client */ + t_binbuf *b; /* reusable, for processing messages from the gui */ };
static t_class *manager_class; ! t_manager *manager; ! t_manager *origin=0; /* 0 means unknown */
void manager_call (void *foo) { *************** *** 294,297 **** --- 301,305 ---- self->clock = clock_new(self,(t_method)manager_call); self->serial = 0; + self->b = binbuf_new(); clock_delay(self->clock,0); return self; *************** *** 301,304 **** --- 309,313 ---- clock_free(self->clock); queue_free(self->q); + binbuf_free(self->b); pd_free(self); } *************** *** 306,309 **** --- 315,333 ---- void manager_nevermind (t_gobj *victim) {queue_nevermind(manager->q,victim);}
+ /* this has to change later when we get multiple managers (and thus the manager variable will disappear) */ + /* this also has to change when we get stackable origins */ + extern "C" void manager_anything (t_manager *self, t_symbol *s, int argc, t_atom *argv) { + /* + t_binbuf b = {argc,argv}; + origin = manager; + binbuf_eval(&b,0,0,0); + origin = 0; + */ + binbuf_clear(self->b); + binbuf_addv(self->b,"s",s); + binbuf_add(self->b,argc,argv); + binbuf_eval(self->b,0,0,0); + } + //-------------------------------------------------------------------------- /* *************** *** 322,326 ****
extern short next_object; - t_manager *origin=0; /* 0 means unknown */ extern t_pd *newest; t_class *canvas_class; --- 346,349 ---- *************** *** 336,347 **** static t_atom *canvas_newargv;
- /* this has to change later when we get multiple managers (and thus the manager variable will disappear) */ - /* this also has to change when we get stackable origins */ - extern "C" void binbuf_eval_from_client (t_binbuf *b) { - origin = manager; - binbuf_eval(b,0,0,0); - origin = 0; - } - /* add a canvas the list of "root" canvases (toplevels without parents.) */ static void canvas_addtolist(t_canvas *x) { --- 359,362 ---- *************** *** 2240,2248 **** void canvas_drawredrect(t_canvas *x, int doit);
- struct _binbuf { - int b_n; - t_atom *b_vec; - }; - void canvas_add(t_canvas *x, t_gobj *y) { #ifdef DEBUG_CANVAS_ADD --- 2255,2258 ---- *************** *** 3800,3804 **** if (wb) wb->w_parentvisfn(y, owner, x->sc_vec, t, basex, basey, vis); } ! sys_unqueuegui(x); }
--- 3810,3814 ---- if (wb) wb->w_parentvisfn(y, owner, x->sc_vec, t, basex, basey, vis); } ! //sys_unqueuegui(x); }
*************** *** 3809,3813 ****
void scalar_redraw(t_scalar *x, t_canvas *canvas) { ! if (canvas_isvisible(canvas)) sys_queuegui(x, canvas, scalar_doredraw); }
--- 3819,3823 ----
void scalar_redraw(t_scalar *x, t_canvas *canvas) { ! //if (canvas_isvisible(canvas)) sys_queuegui(x, canvas, scalar_doredraw); }
*************** *** 7698,7701 **** --- 7708,7724 ---- EXTERN t_class *glob_pdobject;
+ t_pd *pd_new2(int argc, t_atom *argv) { + if (argv[0].a_type != A_SYMBOL) {error("pd_new2: start with symbol please"); return 0;} + pd_typedmess(&pd_objectmaker,argv[0].a_w.w_symbol,argc-1,argv+1); + return newest; + } + t_pd *pd_new3(const char *s) { + t_binbuf *b = binbuf_new(); + binbuf_text(b,(char *)s,strlen(s)); + t_pd *self = pd_new2(b->b_n,b->b_vec); + binbuf_free(b); + return self; + } + extern "C" void desire_setup(void) { *************** *** 7704,7708 **** s_pd = gensym("pd"); manager_class = class_new(gensym("__manager"), (t_newmethod)manager_new, ! (t_method)manager_free, sizeof(t_manager), CLASS_GOBJ, A_GIMME, 0); class_setnotice(manager_class,manager_notice); manager = manager_new(0,0,0); --- 7727,7732 ---- s_pd = gensym("pd"); manager_class = class_new(gensym("__manager"), (t_newmethod)manager_new, ! (t_method)manager_free, sizeof(t_manager), 0, A_GIMME, 0); ! class_addanything(manager_class,manager_anything); class_setnotice(manager_class,manager_notice); manager = manager_new(0,0,0); *************** *** 7720,7729 **** }
extern "C" void desire_glob_init(void) { ! class_addmethod3(glob_pdobject, glob_update_class_list, "update-class-list", "ss"); ! class_addmethod3(glob_pdobject, glob_update_class_info, "update-class-info", "sss"); ! class_addmethod3(glob_pdobject, glob_update_path, "update-path", ""); ! class_addmethod3(glob_pdobject, glob_help, "help", "s"); ! class_addmethod3(glob_pdobject, glob_redraw, "redraw", ""); }
--- 7744,7758 ---- }
+ /* ---------------------------------------------------------------- */ + /* formerly m_glob.c */ + + extern t_class *glob_pdobject; extern "C" void desire_glob_init(void) { ! t_class *c = glob_pdobject; ! class_addmethod3(c, glob_update_class_list, "update-class-list", "ss"); ! class_addmethod3(c, glob_update_class_info, "update-class-info", "sss"); ! class_addmethod3(c, glob_update_path, "update-path", ""); ! class_addmethod3(c, glob_help, "help", "s"); ! class_addmethod3(c, glob_redraw, "redraw", ""); }