X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fxwt%2FTemplate.java;h=859c39e3bbf7fa6269c7c119be3f23c2e4a3ace2;hb=9a33358173f08013fdacd02c11f3823352bdae23;hp=74eceee5ac154d923a88af029e72acbc32a61b53;hpb=55854fa1b8f8f33fb064674b43761a0515c10960;p=org.ibex.core.git diff --git a/src/org/xwt/Template.java b/src/org/xwt/Template.java index 74eceee..859c39e 100644 --- a/src/org/xwt/Template.java +++ b/src/org/xwt/Template.java @@ -90,6 +90,8 @@ public class Template { /** number of lines in content */ private int content_lines = 0; + /** the line number that this element starts on */ + private int startLine = -1; // Static data/methods /////////////////////////////////////////////////////////////////// @@ -161,7 +163,9 @@ public class Template { * @param pboxes a vector of all box parents on which to put $-references * @param ptemplates a vector of the nodeNames to recieve private references on the pboxes */ - void apply(Box b, Vec pboxes, Vec ptemplates) { + void apply(Box b, Vec pboxes, Vec ptemplates, Function callback, int numerator, int denominator) { + + int original_numerator = numerator; if (pboxes == null) { pboxes = new Vec(); @@ -185,10 +189,15 @@ public class Template { link(); for(int i=0; _preapply != null && i<_preapply.length; i++) - if (_preapply[i] != null) _preapply[i].apply(b, null, null); + if (_preapply[i] != null) { + _preapply[i].apply(b, null, null, callback, numerator, denominator); + numerator += _preapply[i].numUnits(); + } - for (int i=0; children != null && i 0) preapply.copyInto(t.preapply = new String[preapply.size()]); if (postapply.size() > 0) postapply.copyInto(t.postapply = new String[postapply.size()]); @@ -496,6 +529,7 @@ public class Template { Template t2 = new Template(); t2.nodeName = t.nodeName + "." + t.childvect.size(); t2.importlist = t.importlist; + t2.startLine = line; if (!name.equals("box")) t2.preapply = new String[] { name }; // make the new node the current node