Update of /cvsroot/pure-data/externals/miXed/shared/toxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv597/shared/toxy
Modified Files: scriptlet.c Log Message: toxy alpha10
Index: scriptlet.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/shared/toxy/scriptlet.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** scriptlet.c 23 Mar 2004 12:07:21 -0000 1.9 --- scriptlet.c 29 Mar 2004 17:09:52 -0000 1.10 *************** *** 201,210 **** if (cv = scriptlet_canvasvalidate(sp, 0)) { if (!strncmp(&ibuf[1], "tag", 3)) { t_rtext *rt; ! if (cv->gl_owner && glist_isvisible(cv->gl_owner) && ! cv->gl_owner->gl_editor && ! (rt = glist_findrtext(cv->gl_owner, (t_object *)cv))) sprintf(obuf, "%s", rtext_gettag(rt)); else --- 201,211 ---- if (cv = scriptlet_canvasvalidate(sp, 0)) { + t_glist *glist; if (!strncmp(&ibuf[1], "tag", 3)) { t_rtext *rt; ! glist = cv->gl_owner; ! if (glist && glist_isvisible(glist) && glist->gl_editor ! && (rt = glist_findrtext(glist, (t_object *)cv))) sprintf(obuf, "%s", rtext_gettag(rt)); else *************** *** 212,228 **** len = 4; } ! else if (!strncmp(&ibuf[1], "owner", 5)) { ! if (cv->gl_owner && glist_isvisible(cv->gl_owner)) ! sprintf(obuf, ".x%x", (int)cv->gl_owner); else obuf[0] = 0; ! len = 6; } else if (!strncmp(&ibuf[1], "root", 4)) { ! sprintf(obuf, ".x%x", (int)canvas_getrootfor(cv)); len = 5; } /* LATER find out when gl_<coords> are updated, think how to better sync them to Tk. */ --- 213,254 ---- len = 4; } ! else if (!strncmp(&ibuf[1], "parent", 6)) { ! glist = cv->gl_owner; ! if (glist && glist_isvisible(glist)) ! sprintf(obuf, ".x%x", (int)glist); else obuf[0] = 0; ! len = 7; } else if (!strncmp(&ibuf[1], "root", 4)) { ! glist = canvas_getrootfor(cv); ! if (glist && glist_isvisible(glist)) ! sprintf(obuf, ".x%x", (int)glist); ! else ! obuf[0] = 0; len = 5; } + else if (!strncmp(&ibuf[1], "owner", 5)) + { + if (glist = canvas_getrootfor(cv)) + glist = glist->gl_owner; + if (glist && glist_isvisible(glist)) + sprintf(obuf, ".x%x", (int)glist); + else + obuf[0] = 0; + len = 6; + } + else if (!strncmp(&ibuf[1], "top", 3)) + { + glist = cv; + while (glist->gl_owner) glist = glist->gl_owner; + if (glist && glist_isvisible(glist)) + sprintf(obuf, ".x%x", (int)glist); + else + obuf[0] = 0; + len = 4; + } /* LATER find out when gl_<coords> are updated, think how to better sync them to Tk. */ *************** *** 257,260 **** --- 283,291 ---- len = 4; } + else if (!strncmp(&ibuf[1], "dir", 3)) + { + sprintf(obuf, "%s", canvas_getdir(cv)->s_name); + len = 4; + } else loud_error(sp->s_owner, "bad field '%s'", &ibuf[1]); }