From 06c7a7fdaac34512cdc3ff250dec5b1a7ab3052a Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 14 Jul 2011 13:40:13 +0300 Subject: beta 2011.07.14 12:19 --- tex/context/base/strc-itm.lua | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'tex/context/base/strc-itm.lua') diff --git a/tex/context/base/strc-itm.lua b/tex/context/base/strc-itm.lua index 1c7c2adb5..8a745f356 100644 --- a/tex/context/base/strc-itm.lua +++ b/tex/context/base/strc-itm.lua @@ -10,14 +10,29 @@ local structures = structures local itemgroups = structures.itemgroups local jobpasses = job.passes +local setfield = jobpasses.save +local getfield = jobpasses.getfield + function itemgroups.register(name,nofitems,maxwidth) - jobpasses.savedata("itemgroup", { nofitems, maxwidth }) + setfield("itemgroup", { nofitems, maxwidth }) end function itemgroups.nofitems(name,index) - jobpasses.getfield("itemgroup", index, 1, 0) + return getfield("itemgroup", index, 1, 0) end function itemgroups.maxwidth(name,index) - jobpasses.getfield("itemgroup", index, 2, 0) + return getfield("itemgroup", index, 2, 0) +end + +-- interface (might become counter/dimension) + +commands.registeritemgroup = itemgroups.register + +function commands.nofitems(name,index) + context(getfield("itemgroup", index, 1, 0)) +end + +function commands.maxitemwidth(name,index) + context(getfield("itemgroup", index, 2, 0)) end -- cgit v1.2.3