summaryrefslogtreecommitdiff
path: root/tex/context/base/back-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/back-ini.lua')
-rw-r--r--tex/context/base/back-ini.lua175
1 files changed, 110 insertions, 65 deletions
diff --git a/tex/context/base/back-ini.lua b/tex/context/base/back-ini.lua
index 7331758ac..b50699d15 100644
--- a/tex/context/base/back-ini.lua
+++ b/tex/context/base/back-ini.lua
@@ -6,27 +6,37 @@ if not modules then modules = { } end modules ['back-ini'] = {
license = "see context related readme files"
}
-backends = backends or { }
+-- I need to check what is actually needed, maybe some can become
+-- locals.
-local trace_backend = false
+backends = backends or { }
+local backends = backends
-local function nothing() return nil end
+local trace_backend = false trackers.register("backend.initializers", function(v) trace_finalizers = v end)
local report_backends = logs.new("backends")
+local function nothing() return nil end
+
backends.nothing = nothing
backends.nodeinjections = {
+
rgbcolor = nothing,
cmykcolor = nothing,
graycolor = nothing,
spotcolor = nothing,
+
transparency = nothing,
+
overprint = nothing,
knockout = nothing,
+
positive = nothing,
negative = nothing,
+
effect = nothing,
+
startlayer = nothing,
stoplayer = nothing,
switchlayer = nothing,
@@ -36,82 +46,107 @@ backends.nodeinjections = {
addtags = nothing,
+ insertu3d = nothing,
+ insertswf = nothing,
+ insertmovie = nothing,
+ insertsound = nothing,
+
}
backends.codeinjections = {
- prerollreference = nothing,
-
- insertmovie = nothing,
- insertsound = nothing,
-
- presetsymbollist = nothing,
- registersymbol = nothing,
- registeredsymbol = nothing,
-
- registercomment = nothing,
- embedfile = nothing,
- attachfile = nothing,
- adddocumentinfo = nothing,
- setupidentity = nothing,
- setpagetransition = nothing,
- defineviewerlayer = nothing,
- addbookmarks = nothing,
- addtransparencygroup = nothing,
-
- typesetfield = nothing,
- doiffieldelse = nothing,
- doiffieldgroupelse = nothing,
- definefield = nothing,
- clonefield = nothing,
- definefieldset = nothing,
- getfieldgroup = nothing,
- setformsmethod = nothing,
- getdefaultfieldvalue = nothing,
-
- setupcanvas = nothing,
-
- initializepage = nothing,
- initializedocument = nothing,
- finalizepage = nothing,
- finalizedocument = nothing,
-
- flushpageactions = nothing,
- flushdocumentactions = nothing,
-
- insertrenderingwindow = nothing,
- processrendering = nothing,
- kindofrendering = nothing,
- flushrenderingwindow = nothing,
-
- setfigurecolorspace = nothing,
- setfigurealternative = nothing,
-
- enabletags = nothing,
- maptag = nothing,
- mapping = nothing, -- returns table
-
- mergereferences = nothing,
- mergelayers = nothing,
-
- setformat = nothing,
- getformatoption = nothing,
+ prerollreference = nothing,
+
+ presetsymbol = nothing,
+ presetsymbollist = nothing,
+ registersymbol = nothing,
+ registeredsymbol = nothing,
+
+ registercomment = nothing,
+
+ embedfile = nothing,
+ attachfile = nothing,
+ attachmentid = nothing,
+
+ adddocumentinfo = nothing,
+ setupidentity = nothing,
+ setupcanvas = nothing,
+
+ setpagetransition = nothing,
+
+ defineviewerlayer = nothing,
+
+ addbookmarks = nothing,
+
+ addtransparencygroup = nothing,
+
+ typesetfield = nothing,
+ doiffieldelse = nothing,
+ doiffieldgroupelse = nothing,
+ doiffieldsetelse = nothing,
+ definefield = nothing,
+ clonefield = nothing,
+ definefieldset = nothing,
+ setfieldcalculationset = nothing,
+ getfieldgroup = nothing,
+ getfieldset = nothing,
+ setformsmethod = nothing,
+ getdefaultfieldvalue = nothing,
+
+ flushpageactions = nothing,
+ flushdocumentactions = nothing,
+
+ insertrenderingwindow = nothing,
+ processrendering = nothing,
+
+ setfigurecolorspace = nothing,
+ setfigurealternative = nothing,
+
+ enabletags = nothing,
+ maptag = nothing,
+ mapping = nothing, -- returns table
+
+ mergereferences = nothing,
+ mergeviewerlayers = nothing,
+
+ setformat = nothing,
+ getformatoption = nothing,
+ supportedformats = nothing,
+
+ -- called in tex
+
+ finalizepage = nothing -- will go when we have a hook at the lua end
+
}
backends.registrations = {
+
grayspotcolor = nothing,
rgbspotcolor = nothing,
cmykspotcolor = nothing,
+
grayindexcolor = nothing,
rgbindexcolor = nothing,
cmykindexcolor = nothing,
+
spotcolorname = nothing,
+
transparency = nothing,
+
}
-local nodeinjections = backends.nodeinjections
-local codeinjections = backends.codeinjections
-local registrations = backends.registrations
+local comment = { "comment", "" }
+
+backends.tables = {
+ vfspecials = {
+ red = comment,
+ green = comment,
+ blue = comment,
+ black = comment,
+ startslant = comment,
+ stopslant = comment,
+ }
+}
backends.current = "unknown"
@@ -123,10 +158,10 @@ function backends.install(what)
report_backends("initializing backend %s (%s)",what,backend.comment or "no comment")
end
backends.current = what
- for _, category in next, { "nodeinjections", "codeinjections", "registrations"} do
+ for _, category in next, { "nodeinjections", "codeinjections", "registrations", "tables" } do
local plugin = backend[category]
+ local whereto = backends[category]
if plugin then
- local whereto = backends[category]
for name, meaning in next, whereto do
if plugin[name] then
whereto[name] = plugin[name]
@@ -138,8 +173,18 @@ function backends.install(what)
elseif trace_backend then
report_backends("no category %s in %s",category,what)
end
+ -- extra checks
+ for k, v in next, whereto do
+ if not plugin[k] then
+ report_backends("entry %s in %s is not set",k,category)
+ end
+ end
+ for k, v in next, plugin do
+ if not whereto[k] then
+ report_backends("entry %s in %s is not used",k,category)
+ end
+ end
end
- backends.helpers = backend.helpers
elseif trace_backend then
report_backends("no backend named %s",what)
end