summaryrefslogtreecommitdiff
path: root/tex/context/base/back-ini.lua
blob: 0a11c2ef7ca3f182c2d0b8b12844bf394ed15186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
if not modules then modules = { } end modules ['back-ini'] = {
    version   = 1.001,
    comment   = "companion to back-ini.tex",
    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
    copyright = "PRAGMA ADE / ConTeXt Development Team",
    license   = "see context related readme files"
}

backends = backends or { }

local function nothing() return nil end

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,
}

backends.codeinjections = {
    insertmovie        = nothing,
}

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

backends.current = "unknown"

function backends.install(what)
    if type(what) == "string" then
        backends.current = what
        what = backends[what]
        if what then
            local wi = what.nodeinjections
            if wi then
                for k, v in next, wi do
                    nodeinjections[k] = v
                end
            end
            local wi = what.codeinjections
            if wi then
                for k, v in next, wi do
                    codeinjections[k] = v
                end
            end
            local wi = what.registrations
            if wi then
                for k, v in next, wi do
                    registrations[k] = v
                end
            end
        end
    end
end