Commit 6f8fc1ed authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

add a hack for sending event notifications out the rightmost outlet of [draw group]

parent cf3d8ac5
......@@ -1175,6 +1175,8 @@ typedef struct _drawimage
t_pd *x_attr;
} t_drawimage;
extern t_outlet *obj_rightmost_outlet(t_object *x);
void draw_notifyforscalar(t_object *x, t_glist *owner,
t_scalar *sc, t_symbol *s, int argc, t_atom *argv)
{
......@@ -1187,8 +1189,15 @@ void draw_notifyforscalar(t_object *x, t_glist *owner,
binbuf_add(b, 1, at);
binbuf_add(b, argc, argv);
if (x)
outlet_anything(x->ob_outlet, s, binbuf_getnatom(b),
{
t_outlet *out;
if (pd_class(&x->te_pd) == canvas_class)
out = obj_rightmost_outlet(x);
else
out = x->ob_outlet;
outlet_anything(out, s, binbuf_getnatom(b),
binbuf_getvec(b));
}
gpointer_unset(&gp);
binbuf_free(b);
}
......
......@@ -579,6 +579,20 @@ int obj_noutlets(t_object *x)
return (n);
}
/* used for draw_notify */
t_outlet *obj_rightmost_outlet(t_object *x)
{
t_outlet *o = x->ob_outlet;
if (o)
{
while (o->o_next)
o = o->o_next;
return o;
}
else
return 0;
}
int obj_ninlets(t_object *x)
{
int n;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment