summaryrefslogtreecommitdiff
path: root/tex/context/base/anch-pos.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/anch-pos.lua')
-rw-r--r--tex/context/base/anch-pos.lua489
1 files changed, 326 insertions, 163 deletions
diff --git a/tex/context/base/anch-pos.lua b/tex/context/base/anch-pos.lua
index 9cc9fb128..77e36e85e 100644
--- a/tex/context/base/anch-pos.lua
+++ b/tex/context/base/anch-pos.lua
@@ -14,11 +14,13 @@ more efficient.</p>
-- plus (extra) is obsolete but we will keep it for a while
+-- context(new_latelua_node(f_enhance(tag)))
+-- =>
+-- context.lateluafunction(function() f_enhance(tag) end)
+
-- maybe replace texsp by our own converter (stay at the lua end)
-- eventually mp will have large numbers so we can use sp there too
-local commands, context = commands, context
-
local tostring, next, rawget, setmetatable = tostring, next, rawget, setmetatable
local sort = table.sort
local format, gmatch, match = string.format, string.gmatch, string.match
@@ -26,19 +28,41 @@ local rawget = rawget
local lpegmatch = lpeg.match
local insert, remove = table.insert, table.remove
local allocate, mark = utilities.storage.allocate, utilities.storage.mark
-local texsp = tex.sp
------ texsp = string.todimen -- because we cache this is much faster but no rounding
+local scanners = tokens.scanners
+local scanstring = scanners.string
+local scaninteger = scanners.integer
+local scandimen = scanners.dimen
+
+local compilescanner = tokens.compile
+local scanners = interfaces.scanners
+
+local commands = commands
+local context = context
+
+local tex = tex
local texgetcount = tex.getcount
-local texgetbox = tex.getbox
local texsetcount = tex.setcount
local texget = tex.get
+local texsp = tex.sp
+----- texsp = string.todimen -- because we cache this is much faster but no rounding
local pdf = pdf -- h and v are variables
local setmetatableindex = table.setmetatableindex
-local new_latelua = nodes.pool.latelua
-local find_tail = node.slide
+
+local nuts = nodes.nuts
+
+local getfield = nuts.getfield
+local setfield = nuts.setfield
+local getlist = nuts.getlist
+local getbox = nuts.getbox
+local getskip = nuts.getskip
+
+local find_tail = nuts.tail
+
+local new_latelua = nuts.pool.latelua
+local new_latelua_node = nodes.pool.latelua
local variables = interfaces.variables
local v_text = variables.text
@@ -104,11 +128,28 @@ local nofusedregions = 0
local nofmissingregions = 0
local nofregular = 0
+jobpositions.used = false
+
-- todo: register subsets and count them indepently
local function initializer()
tobesaved = jobpositions.tobesaved
collected = jobpositions.collected
+ -- add sparse regions
+ local pages = structures.pages.collected
+ if pages then
+ local last = nil
+ for p=1,#pages do
+ local region = "page:" .. p
+ local data = collected[region]
+ if data then
+ last = data
+ last.p = nil -- no need for a page
+ elseif last then
+ collected[region] = last
+ end
+ end
+ end
-- enhance regions with paragraphs
for tag, data in next, collected do
local region = data.r
@@ -148,6 +189,7 @@ local function initializer()
end
-- so, we can be sparse and don't need 'or 0' code
end
+ jobpositions.used = next(collected)
end
job.register('job.positions.collected', tobesaved, initializer)
@@ -164,9 +206,12 @@ local nofpages = nil
-- beware ... we're not sparse here as lua will reserve slots for the nilled
+local getpos = function() getpos = backends.codeinjections.getpos return getpos () end
+local gethpos = function() gethpos = backends.codeinjections.gethpos return gethpos() end
+local getvpos = function() getvpos = backends.codeinjections.getvpos return getvpos() end
+
local function setdim(name,w,h,d,extra) -- will be used when we move to sp allover
- local x = pdf.h
- local y = pdf.v
+ local x, y = getpos()
if x == 0 then x = nil end
if y == 0 then y = nil end
if w == 0 then w = nil end
@@ -216,10 +261,13 @@ local function enhance(data)
data.r = region
end
if data.x == true then
- data.x = pdf.h
- end
- if data.y == true then
- data.y = pdf.v
+ if data.y == true then
+ data.x, data.y = getpos()
+ else
+ data.x = gethpos()
+ end
+ elseif data.y == true then
+ data.y = getvpos()
end
if data.p == true then
data.p = texgetcount("realpageno")
@@ -239,9 +287,15 @@ local function enhance(data)
return data
end
-local function set(name,index,val)
+-- analyze some files (with lots if margindata) and then when one key optionally
+-- use that one instead of a table (so, a 3rd / 4th argument: key, e.g. "x")
+
+local function set(name,index,val) -- ,key
local data = enhance(val or index)
if val then
+-- if data[key] and not next(next(data)) then
+-- data = data[key]
+-- end
container = tobesaved[name]
if not container then
tobesaved[name] = {
@@ -269,7 +323,26 @@ jobpositions.setall = setall
jobpositions.set = set
jobpositions.get = get
-commands.setpos = setall
+-- scanners.setpos = setall
+
+-- trackers.enable("tokens.compi*")
+
+-- something weird: the compiler fails us here
+
+scanners.dosaveposition = compilescanner {
+ actions = setall, -- name p x y
+ arguments = { "string", "integer", "dimen", "dimen" }
+}
+
+scanners.dosavepositionwhd = compilescanner { -- somehow fails
+ actions = setall, -- name p x y w h d
+ arguments = { "string", "integer", "dimen", "dimen", "dimen", "dimen", "dimen" }
+}
+
+scanners.dosavepositionplus = compilescanner {
+ actions = setall, -- name p x y w h d extra
+ arguments = { "string", "integer", "dimen", "dimen", "dimen", "dimen", "dimen", "string" }
+}
-- will become private table (could also become attribute driven but too nasty
-- as attributes can bleed e.g. in margin stuff)
@@ -279,7 +352,7 @@ commands.setpos = setall
function jobpositions.b_col(tag)
tobesaved[tag] = {
r = true,
- x = pdf.h,
+ x = gethpos(),
w = 0,
}
insert(columns,tag)
@@ -291,25 +364,33 @@ function jobpositions.e_col(tag)
if not t then
-- something's wrong
else
- t.w = pdf.h - t.x
+ t.w = gethpos() - t.x
t.r = region
end
remove(columns)
column = columns[#columns]
end
-function commands.bcolumn(tag,register) -- name will change
+scanners.bposcolumn = function() -- tag
+ local tag = scanstring()
insert(columns,tag)
column = tag
- if register then
- context(new_latelua(f_b_column(tag)))
- end
end
-function commands.ecolumn(register) -- name will change
- if register then
- context(new_latelua(f_e_column()))
- end
+scanners.bposcolumnregistered = function() -- tag
+ local tag = scanstring()
+ insert(columns,tag)
+ column = tag
+ context(new_latelua_node(f_b_column(tag)))
+end
+
+scanners.eposcolumn = function()
+ remove(columns)
+ column = columns[#columns]
+end
+
+scanners.eposcolumnregistered = function()
+ context(new_latelua_node(f_e_column()))
remove(columns)
column = columns[#columns]
end
@@ -318,8 +399,7 @@ end
function jobpositions.b_region(tag)
local last = tobesaved[tag]
- last.x = pdf.h
- last.y = pdf.v
+ last.x, last.y = getpos()
last.p = texgetcount("realpageno")
insert(regions,tag)
region = tag
@@ -327,75 +407,85 @@ end
function jobpositions.e_region(correct)
local last = tobesaved[region]
+ local v = getvpos()
if correct then
- last.h = last.y - pdf.v
+ last.h = last.y - v
end
- last.y = pdf.v
+ last.y = v
remove(regions)
region = regions[#regions]
end
-function jobpositions.markregionbox(n,tag,correct)
+local function setregionbox(n,tag)
if not tag or tag == "" then
nofregions = nofregions + 1
tag = f_region(nofregions)
end
- local box = texgetbox(n)
- local w = box.width
- local h = box.height
- local d = box.depth
+ local box = getbox(n)
+ local w = getfield(box,"width")
+ local h = getfield(box,"height")
+ local d = getfield(box,"depth")
tobesaved[tag] = {
p = true,
x = true,
- y = pdf.v, -- true,
+ y = getvpos(), -- true,
w = w ~= 0 and w or nil,
h = h ~= 0 and h or nil,
d = d ~= 0 and d or nil,
}
+ return tag, box
+end
+
+local function markregionbox(n,tag,correct)
+ local tag, box = setregionbox(n,tag)
local push = new_latelua(f_b_region(tag))
local pop = new_latelua(f_e_region(tostring(correct))) -- todo: check if tostring is needed with formatter
-- maybe we should construct a hbox first (needs experimenting) so that we can avoid some at the tex end
- local head = box.list
+ local head = getlist(box)
if head then
local tail = find_tail(head)
- head.prev = push
- push.next = head
- pop .prev = tail
- tail.next = pop
+ setfield(head,"prev",push)
+ setfield(push,"next",head)
+ setfield(pop,"prev",tail)
+ setfield(tail,"next",pop)
else -- we can have a simple push/pop
- push.next = pop
- pop.prev = push
+ setfield(push,"next",pop)
+ setfield(pop,"prev",push)
end
- box.list = push
+ setfield(box,"list",push)
end
+jobpositions.markregionbox = markregionbox
+jobpositions.setregionbox = setregionbox
+
function jobpositions.enhance(name)
enhance(tobesaved[name])
end
-function commands.pos(name,t)
- tobesaved[name] = t
- context(new_latelua(f_enhance(name)))
-end
+-- scanners.pos = function(name,t) -- name t
+-- local name = scanstring()
+-- tobesaved[name] = scanstring()
+-- context(new_latelua_node(f_enhance(name)))
+-- end
local nofparagraphs = 0
-function commands.parpos() -- todo: relate to localpar (so this is an intermediate variant)
+scanners.parpos = function() -- todo: relate to localpar (so this is an intermediate variant)
nofparagraphs = nofparagraphs + 1
texsetcount("global","c_anch_positions_paragraph",nofparagraphs)
- local strutbox = texgetbox("strutbox")
+ local strutbox = getbox("strutbox")
local t = {
p = true,
c = true,
r = true,
x = true,
y = true,
- h = strutbox.height,
- d = strutbox.depth,
+ h = getfield(strutbox,"height"),
+ d = getfield(strutbox,"depth"),
hs = texget("hsize"),
}
- local leftskip = texget("leftskip").width
- local rightskip = texget("rightskip").width
+ local leftskip = getfield(getskip("leftskip"),"width")
+ local rightskip = getfield(getskip("rightskip"),"width")
local hangindent = texget("hangindent")
local hangafter = texget("hangafter")
local parindent = texget("parindent")
@@ -420,10 +510,11 @@ function commands.parpos() -- todo: relate to localpar (so this is an intermedia
end
local tag = f_p_tag(nofparagraphs)
tobesaved[tag] = t
- context(new_latelua(f_enhance(tag)))
+ context(new_latelua_node(f_enhance(tag)))
end
-function commands.posxy(name) -- can node.write be used here?
+scanners.dosetposition = function() -- name
+ local name = scanstring()
tobesaved[name] = {
p = true,
c = column,
@@ -432,53 +523,73 @@ function commands.posxy(name) -- can node.write be used here?
y = true,
n = nofparagraphs > 0 and nofparagraphs or nil,
}
- context(new_latelua(f_enhance(name)))
+ context(new_latelua_node(f_enhance(name)))
end
-function commands.poswhd(name,w,h,d)
+scanners.dosetpositionwhd = function() -- name w h d extra
+ local name = scanstring()
tobesaved[name] = {
p = true,
c = column,
r = true,
x = true,
y = true,
- w = w,
- h = h,
- d = d,
+ w = scandimen(),
+ h = scandimen(),
+ d = scandimen(),
n = nofparagraphs > 0 and nofparagraphs or nil,
}
- context(new_latelua(f_enhance(name)))
+ context(new_latelua_node(f_enhance(name)))
end
-function commands.posplus(name,w,h,d,extra)
+scanners.dosetpositionbox = function() -- name box
+ local name = scanstring()
+ local box = getbox(scaninteger())
tobesaved[name] = {
p = true,
c = column,
r = true,
x = true,
y = true,
- w = w,
- h = h,
- d = d,
+ w = getfield(box,"width"),
+ h = getfield(box,"height"),
+ d = getfield(box,"depth"),
n = nofparagraphs > 0 and nofparagraphs or nil,
- e = extra,
}
- context(new_latelua(f_enhance(name)))
+ context(new_latelua_node(f_enhance(name)))
+end
+
+scanners.dosetpositionplus = function() -- name w h d extra
+ local name = scanstring()
+ tobesaved[name] = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ w = scandimen(),
+ h = scandimen(),
+ d = scandimen(),
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ e = scanstring(),
+ }
+ context(new_latelua_node(f_enhance(name)))
end
-function commands.posstrut(name,w,h,d)
- local strutbox = texgetbox("strutbox")
+scanners.dosetpositionstrut = function() -- name
+ local name = scanstring()
+ local strutbox = getbox("strutbox")
tobesaved[name] = {
p = true,
c = column,
r = true,
x = true,
y = true,
- h = strutbox.height,
- d = strutbox.depth,
+ h = getfield(strutbox,"height"),
+ d = getfield(strutbox,"depth"),
n = nofparagraphs > 0 and nofparagraphs or nil,
}
- context(new_latelua(f_enhance(name)))
+ context(new_latelua_node(f_enhance(name)))
end
function jobpositions.getreserved(tag,n)
@@ -512,7 +623,17 @@ end
function jobpositions.region(id)
local jpi = collected[id]
- return jpi and jpi.r or false
+ if jpi then
+ local r = jpi.r
+ if r then
+ return r
+ end
+ local p = jpi.p
+ if p then
+ return "page:" .. p
+ end
+ end
+ return false
end
function jobpositions.column(id)
@@ -718,11 +839,23 @@ jobpositions.onsamepage = onsamepage
-- interface
-commands.replacepospxywhd = jobpositions.replace
-commands.copyposition = jobpositions.copy
+scanners.replacepospxywhd = function() -- name page x y w h d
+ collected[scanstring()] = {
+ p = scaninteger(),
+ x = scandimen(),
+ y = scandimen(),
+ w = scandimen(),
+ h = scandimen(),
+ d = scandimen(),
+ }
+end
-function commands.MPp(id)
- local jpi = collected[id]
+scanners.copyposition = function() -- target source
+ collected[scanstring()] = collected[scanstring()]
+end
+
+scanners.MPp = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
local p = jpi.p
if p and p ~= true then
@@ -733,70 +866,70 @@ function commands.MPp(id)
context('0')
end
-function commands.MPx(id)
- local jpi = collected[id]
+scanners.MPx = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
local x = jpi.x
if x and x ~= true and x ~= 0 then
- context("%.5fpt",x*pt)
+ context("%.5Fpt",x*pt)
return
end
end
context('0pt')
end
-function commands.MPy(id)
- local jpi = collected[id]
+scanners.MPy = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
local y = jpi.y
if y and y ~= true and y ~= 0 then
- context("%.5fpt",y*pt)
+ context("%.5Fpt",y*pt)
return
end
end
context('0pt')
end
-function commands.MPw(id)
- local jpi = collected[id]
+scanners.MPw = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
local w = jpi.w
if w and w ~= 0 then
- context("%.5fpt",w*pt)
+ context("%.5Fpt",w*pt)
return
end
end
context('0pt')
end
-function commands.MPh(id)
- local jpi = collected[id]
+scanners.MPh = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
local h = jpi.h
if h and h ~= 0 then
- context("%.5fpt",h*pt)
+ context("%.5Fpt",h*pt)
return
end
end
context('0pt')
end
-function commands.MPd(id)
- local jpi = collected[id]
+scanners.MPd = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
local d = jpi.d
if d and d ~= 0 then
- context("%.5fpt",d*pt)
+ context("%.5Fpt",d*pt)
return
end
end
context('0pt')
end
-function commands.MPxy(id)
- local jpi = collected[id]
+scanners.MPxy = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
- context('(%.5fpt,%.5fpt)',
+ context('(%.5Fpt,%.5Fpt)',
jpi.x*pt,
jpi.y*pt
)
@@ -805,10 +938,10 @@ function commands.MPxy(id)
end
end
-function commands.MPll(id)
- local jpi = collected[id]
+scanners.MPll = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
- context('(%.5fpt,%.5fpt)',
+ context('(%.5Fpt,%.5Fpt)',
jpi.x *pt,
(jpi.y-jpi.d)*pt
)
@@ -817,10 +950,10 @@ function commands.MPll(id)
end
end
-function commands.MPlr(id)
- local jpi = collected[id]
+scanners.MPlr = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
- context('(%.5fpt,%.5fpt)',
+ context('(%.5Fpt,%.5Fpt)',
(jpi.x + jpi.w)*pt,
(jpi.y - jpi.d)*pt
)
@@ -829,10 +962,10 @@ function commands.MPlr(id)
end
end
-function commands.MPur(id)
- local jpi = collected[id]
+scanners.MPur = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
- context('(%.5fpt,%.5fpt)',
+ context('(%.5Fpt,%.5Fpt)',
(jpi.x + jpi.w)*pt,
(jpi.y + jpi.h)*pt
)
@@ -841,10 +974,10 @@ function commands.MPur(id)
end
end
-function commands.MPul(id)
- local jpi = collected[id]
+scanners.MPul = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
- context('(%.5fpt,%.5fpt)',
+ context('(%.5Fpt,%.5Fpt)',
jpi.x *pt,
(jpi.y + jpi.h)*pt
)
@@ -858,7 +991,7 @@ local function MPpos(id)
if jpi then
local p = jpi.p
if p then
- context("%s,%.5fpt,%.5fpt,%.5fpt,%.5fpt,%.5fpt",
+ context("%s,%.5Fpt,%.5Fpt,%.5Fpt,%.5Fpt,%.5Fpt",
p,
jpi.x*pt,
jpi.y*pt,
@@ -872,10 +1005,12 @@ local function MPpos(id)
context('0,0,0,0,0,0') -- for mp only
end
-commands.MPpos = MPpos
+scanners.MPpos = function() -- name
+ MPpos(scanstring())
+end
-function commands.MPn(id)
- local jpi = collected[id]
+scanners.MPn = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
local n = jpi.n
if n then
@@ -886,25 +1021,28 @@ function commands.MPn(id)
context(0)
end
-function commands.MPc(id)
- local jpi = collected[id]
+scanners.MPc = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
local c = jpi.c
- if c and p ~= true then
+ if c and c ~= true then
context(c)
return
end
end
- context(c) -- number
+ context('0') -- okay ?
end
-function commands.MPr(id)
- local jpi = collected[id]
+scanners.MPr = function() -- name
+ local jpi = collected[scanstring()]
if jpi then
local r = jpi.r
- if r and p ~= true then
+ if r and r ~= true then
context(r)
- return
+ end
+ local p = jpi.p
+ if p then
+ context("page:" .. p)
end
end
end
@@ -916,7 +1054,7 @@ local function MPpardata(n)
t = collected[tag]
end
if t then
- context("%.5fpt,%.5fpt,%.5fpt,%.5fpt,%s,%.5fpt",
+ context("%.5Fpt,%.5Fpt,%.5Fpt,%.5Fpt,%s,%.5Fpt",
t.hs*pt,
t.ls*pt,
t.rs*pt,
@@ -929,29 +1067,32 @@ local function MPpardata(n)
end
end
-commands.MPpardata = MPpardata
+scanners.MPpardata = function() -- name
+ MPpardata(scanstring())
+end
-function commands.MPposset(id) -- special helper, used in backgrounds
- local b = f_b_tag(id)
- local e = f_e_tag(id)
- local w = f_w_tag(id)
+scanners.MPposset = function() -- name (special helper, used in backgrounds)
+ local name = scanstring()
+ local b = f_b_tag(name)
+ local e = f_e_tag(name)
+ local w = f_w_tag(name)
local p = f_p_tag(jobpositions.n(b))
MPpos(b) context(",") MPpos(e) context(",") MPpos(w) context(",") MPpos(p) context(",") MPpardata(p)
end
-function commands.MPls(id)
- local t = collected[id]
- if t then
- context("%.5fpt",t.ls*pt)
+scanners.MPls = function() -- name
+ local jpi = collected[scanstring()]
+ if jpi then
+ context("%.5Fpt",jpi.ls*pt)
else
context("0pt")
end
end
-function commands.MPrs(id)
- local t = collected[id]
- if t then
- context("%.5fpt",t.rs*pt)
+scanners.MPrs = function() -- name
+ local jpi = collected[scanstring()]
+ if jpi then
+ context("%.5Fpt",jpi.rs*pt)
else
context("0pt")
end
@@ -959,8 +1100,10 @@ end
local splitter = lpeg.tsplitat(",")
-function commands.MPplus(id,n,default)
- local jpi = collected[id]
+scanners.MPplus = function() -- name n default
+ local jpi = collected[scanstring()]
+ local n = scaninteger()
+ local default = scanstring()
if jpi then
local e = jpi.e
if e then
@@ -976,59 +1119,79 @@ function commands.MPplus(id,n,default)
context(default)
end
-function commands.MPrest(id,default)
- local jpi = collected[id]
+scanners.MPrest = function() -- name default
+ local jpi = collected[scanstring()]
+ local default = scanstring()
context(jpi and jpi.e or default)
end
-function commands.MPxywhd(id)
- local t = collected[id]
- if t then
- context("%.5fpt,%.5fpt,%.5fpt,%.5fpt,%.5fpt",
- t.x*pt,
- t.y*pt,
- t.w*pt,
- t.h*pt,
- t.d*pt
+scanners.MPxywhd = function() -- name
+ local jpi = collected[scanstring()]
+ if jpi then
+ context("%.5Fpt,%.5Fpt,%.5Fpt,%.5Fpt,%.5Fpt",
+ jpi.x*pt,
+ jpi.y*pt,
+ jpi.w*pt,
+ jpi.h*pt,
+ jpi.d*pt
)
else
context("0,0,0,0,0") -- for mp only
end
end
-local doif, doifelse = commands.doif, commands.doifelse
+local doif = commands.doif
+local doifelse = commands.doifelse
-function commands.doifpositionelse(name)
- doifelse(collected[name])
+scanners.doifelseposition = function() -- name
+ doifelse(collected[scanstring()])
end
-function commands.doifposition(name)
- doif(collected[name])
+scanners.doifposition = function() -- name
+ doif(collected[scanstring()])
end
-function commands.doifpositiononpage(name,page) -- probably always realpageno
- local c = collected[name]
- doifelse(c and c.p == page)
+scanners.doifelsepositiononpage = function() -- name page -- probably always realpageno
+ local c = collected[scanstring()]
+ local p = scaninteger()
+ doifelse(c and c.p == p)
end
-function commands.doifoverlappingelse(one,two,overlappingmargin)
- doifelse(overlapping(one,two,overlappingmargin))
+scanners.doifelseoverlapping = function() -- one two
+ doifelse(overlapping(scanstring(),scanstring()))
end
-function commands.doifpositionsonsamepageelse(list,page)
- doifelse(onsamepage(list))
+scanners.doifelsepositionsonsamepage = function() -- list
+ doifelse(onsamepage(scanstring()))
end
-function commands.doifpositionsonthispageelse(list)
- doifelse(onsamepage(list,tostring(texgetcount("realpageno"))))
+scanners.doifelsepositionsonthispage = function() -- list
+ doifelse(onsamepage(scanstring(),tostring(texgetcount("realpageno"))))
end
-function commands.doifelsepositionsused()
+scanners.doifelsepositionsused = function()
doifelse(next(collected))
end
-commands.markcolumnbox = jobpositions.markcolumnbox
-commands.markregionbox = jobpositions.markregionbox
+scanners.markregionbox = function() -- box
+ markregionbox(scaninteger())
+end
+
+scanners.setregionbox = function() -- box
+ setregionbox(scaninteger())
+end
+
+scanners.markregionboxtagged = function() -- box tag
+ markregionbox(scaninteger(),scanstring())
+end
+
+scanners.setregionboxtagged = function() -- box tag
+ setregionbox(scaninteger(),scanstring())
+end
+
+scanners.markregionboxcorrected = function() -- box tag
+ markregionbox(scaninteger(),scanstring(),true)
+end
-- statistics (at least for the moment, when testing)