Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv373
Modified Files: Tag: devel_0_39 desire.c Log Message: removed [guiconnect]
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.212 retrieving revision 1.1.2.213 diff -C2 -d -r1.1.2.212 -r1.1.2.213 *** desire.c 28 Nov 2006 14:23:49 -0000 1.1.2.212 --- desire.c 28 Nov 2006 19:05:36 -0000 1.1.2.213 *************** *** 319,322 **** --- 319,323 ---- #endif
+ extern short next_object; extern t_pd *newest; t_class *canvas_class; *************** *** 484,489 **** }
- t_guiconnect *guiconnect_new(t_pd *who, t_symbol *sym); - /* make a new canvas. It will either be a "root" canvas or else its parent will be a "text" object in another window... we don't know which yet. */ --- 485,488 ---- *************** *** 495,499 **** int height = CANVAS_DEFCANVASHEIGHT, yloc = CANVAS_DEFCANVASYLOC; int vis=0, font = owner?owner->font:sys_defaultfont; - char buf[40]; canvas_init(x); x->te_type = T_OBJECT; --- 494,497 ---- *************** *** 541,546 **** x->next_add = -1; x->connectbuf = binbuf_new(); - sprintf(buf, ".x%lx", (long)x); - x->guiconnect = guiconnect_new(x,gensym(buf)); return x; } --- 539,542 ---- *************** *** 674,679 **** }
- static void guiconnect_notarget(t_guiconnect *x, double timedelay); - /* canvas_vis(,1) makes a canvas client-existing, client-updated, visible, mapped, raised. gops get open. canvas_vis(,0) removes the canvas from the client if it's non-gop. contrast with canvas_map. --- 670,673 ---- *************** *** 726,730 **** gfxstub_deleteforkey(x); /* probably unnecessary */ if (!x->owner) canvas_takeofflist(x); - guiconnect_notarget(x->guiconnect, 1000); binbuf_free(x->connectbuf); } --- 720,723 ---- *************** *** 2681,2751 **** */
- /* a thing to forward messages from the GUI, dealing with race conditions - in which the "target" gets deleted while the GUI is sending it something. - this is prolly a leftover that doesn't work with DesireData. - */ - - struct _guiconnect : t_object { - t_pd *who; - t_symbol *sym; - t_clock *clock; - }; - - static t_class *guiconnect_class; - - t_guiconnect *guiconnect_new(t_pd *who, t_symbol *sym) { - t_guiconnect *x = (t_guiconnect *)pd_new(guiconnect_class); - x->who = who; - x->sym = sym; - pd_bind(x,sym); - return x; - } - - /* cleanup routine; delete any resources we have */ - static void guiconnect_free(t_guiconnect *x) { - if (x->sym) pd_unbind(x,x->sym); - if (x->clock) clock_free(x->clock); - } - - /* this is called when the clock times out to indicate the GUI should be gone by now. */ - static void guiconnect_tick(t_guiconnect *x) {pd_free(x);} - - /* the target calls this to disconnect. If the gui has "signed off" - we're ready to delete the object; otherwise we wait either for signoff - or for a timeout. */ - static void guiconnect_notarget(t_guiconnect *x, double timedelay) { - if (!x->sym) pd_free(x); - else { - x->who = 0; - if (timedelay > 0) { - x->clock = clock_new(x, (t_method)guiconnect_tick); - clock_delay(x->clock, timedelay); - } - } - } - - /* the GUI calls this to send messages to the target. */ - static void guiconnect_anything(t_guiconnect *x, t_symbol *s, int ac, t_atom *av) { - if (x->who) typedmess(x->who, s, ac, av); - } - - /* the GUI calls this when it disappears. (If there's any chance the - GUI will fail to do this, the "target", when it signs off, should specify - a timeout after which the guiconnect will disappear.) */ - static void guiconnect_signoff(t_guiconnect *x) { - if (!x->who) pd_free(x); - else { - pd_unbind(x,x->sym); - x->sym = 0; - } - } - - static void g_guiconnect_setup(void) { - guiconnect_class = class_new(gensym("guiconnect"), 0, - (t_method)guiconnect_free, sizeof(t_guiconnect), CLASS_PD, 0); - class_addanything(guiconnect_class, guiconnect_anything); - class_addmethod3(guiconnect_class, guiconnect_signoff, "signoff", ""); - } - /* this file reads and writes the "data" portions of a canvas to a file. See also canvas_saveto(), etc., in g_editor.c. The data portion is a --- 2674,2677 ---- *************** *** 7759,7763 **** #define S(x) x##_setup(); S(vinlet) S(voutlet) ! S(g_array) S(g_canvas) S(g_guiconnect) S(g_scalar) S(g_template) S(g_traversal) S(g_text) S(g_bang) S(g_toggle) S(g_radio) S(g_slider) S(g_numbox) S(g_mycanvas) S(g_vumeter) S(g_dropper) --- 7685,7689 ---- #define S(x) x##_setup(); S(vinlet) S(voutlet) ! S(g_array) S(g_canvas) S(g_scalar) S(g_template) S(g_traversal) S(g_text) S(g_bang) S(g_toggle) S(g_radio) S(g_slider) S(g_numbox) S(g_mycanvas) S(g_vumeter) S(g_dropper)