/* Copyright (c) 1997-2000 Miller Puckette. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ /* 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. See also the gfxstub object that doesn't oblige the owner to keep a pointer around (so is better suited to one-off dialogs) */ #include "m_pd.h" #include "g_canvas.h" struct _guiconnect { … }; static t_class *guiconnect_class; t_guiconnect *guiconnect_new(t_pd *who, t_symbol *sym) { … } /* cleanup routine; delete any resources we have */ static void guiconnect_free(t_guiconnect *x) { … } /* this is called when the clock times out to indicate the GUI should be gone by now. */ static void guiconnect_tick(t_guiconnect *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. */ void guiconnect_notarget(t_guiconnect *x, double 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) { … } /* 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) { … } void g_guiconnect_setup(void) { … }