Revision: 10399 http://pure-data.svn.sourceforge.net/pure-data/?rev=10399&view=rev Author: zmoelnig Date: 2008-11-27 17:10:04 +0000 (Thu, 27 Nov 2008)
Log Message: ----------- accept parent-depth as argument
Modified Paths: -------------- trunk/externals/iem/iemguts/src/canvasargs.c
Modified: trunk/externals/iem/iemguts/src/canvasargs.c =================================================================== --- trunk/externals/iem/iemguts/src/canvasargs.c 2008-11-27 15:59:32 UTC (rev 10398) +++ trunk/externals/iem/iemguts/src/canvasargs.c 2008-11-27 17:10:04 UTC (rev 10399) @@ -91,11 +91,19 @@ { }
-static void *canvasargs_new(void) +static void *canvasargs_new(t_floatarg f) { t_canvasargs *x = (t_canvasargs *)pd_new(canvasargs_class); t_glist *glist=(t_glist *)canvas_getcurrent(); t_canvas *canvas=(t_canvas*)glist_getcanvas(glist); + + int depth=(int)f; + if(depth<0)depth=0; + + while(depth && canvas) { + canvas=canvas->gl_owner; + depth--; + }
x->x_canvas = canvas;
@@ -106,7 +114,7 @@ void canvasargs_setup(void) { canvasargs_class = class_new(gensym("canvasargs"), (t_newmethod)canvasargs_new, - (t_method)canvasargs_free, sizeof(t_canvasargs), 0, 0); + (t_method)canvasargs_free, sizeof(t_canvasargs), 0, A_DEFFLOAT, 0); class_addlist(canvasargs_class, (t_method)canvasargs_list); class_addbang(canvasargs_class, (t_method)canvasargs_bang); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.