summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/syst-ini.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/syst-ini.mkiv')
-rw-r--r--tex/context/base/mkiv/syst-ini.mkiv175
1 files changed, 42 insertions, 133 deletions
diff --git a/tex/context/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv
index 4b04c16ae..7690af018 100644
--- a/tex/context/base/mkiv/syst-ini.mkiv
+++ b/tex/context/base/mkiv/syst-ini.mkiv
@@ -96,21 +96,14 @@
%D Initialization of primitives.
-\directlua 0 { % this info is stored in the format
- lua.name[0] = "main ctx instance"
+\directlua {
+ local baseprimitives = tex.extraprimitives("core","tex")
+ local moreprimitives = tex.extraprimitives("etex","luatex")
- local coreprimitives = tex.extraprimitives("core")
- local texprimitives = tex.extraprimitives("tex")
- local etexprimitives = tex.extraprimitives("etex")
- local luatexprimitives = tex.extraprimitives("luatex")
+ tex.enableprimitives("",moreprimitives)
- tex.enableprimitives("",etexprimitives)
- tex.enableprimitives("",luatexprimitives)
-
- tex.enableprimitives("normal",coreprimitives)
- tex.enableprimitives("normal",texprimitives)
- tex.enableprimitives("normal",etexprimitives)
- tex.enableprimitives("normal",luatexprimitives)
+ tex.enableprimitives("normal",baseprimitives)
+ tex.enableprimitives("normal",moreprimitives)
function tex.enableprimitives() end
}
@@ -126,13 +119,10 @@
\expandafter\def\csname\Uchar\formfeedasciicode \endcsname {\par} % \def\^^L{\par} formfeed
\expandafter\def\csname\Uchar\endoflineasciicode\endcsname {\ } % \def\^^M{\ } return
-%D \ETEX\ has a not so handy way of telling you the version number, i.e. the revision
-%D number has a period in it:
+%D For now:
\def\gobbleoneargument#1{} % will be defined later on anyway
-\mathchardef\etexversion = \numexpr\eTeXversion*100+\expandafter\gobbleoneargument\eTeXrevision\relax
-
%D First we define a simplified version of the \CONTEXT\ protection mechanism.
%D Later we will implement a better variant.
@@ -1014,124 +1004,43 @@
%D Backend:
-% For the moment we define some \pdf... helpers but this will move to the backend
-% module after which the official interfaces have to be used. This is needed for
-% modules not made by ctx developers.
-
-\ifdefined\pdfextension
-
-\normalprotected\def\pdfliteral {\pdfextension literal }
-\normalprotected\def\pdfcolorstack {\pdfextension colorstack }
-\normalprotected\def\pdfsetmatrix {\pdfextension setmatrix }
-\normalprotected\def\pdfsave {\pdfextension save\relax}
-\normalprotected\def\pdfrestore {\pdfextension restore\relax}
-\normalprotected\def\pdfobj {\pdfextension obj }
-\normalprotected\def\pdfrefobj {\pdfextension refobj }
-\normalprotected\def\pdfannot {\pdfextension annot }
-\normalprotected\def\pdfstartlink {\pdfextension startlink }
-\normalprotected\def\pdfendlink {\pdfextension endlink\relax}
-\normalprotected\def\pdfoutline {\pdfextension outline }
-\normalprotected\def\pdfdest {\pdfextension dest }
-\normalprotected\def\pdfthread {\pdfextension thread }
-\normalprotected\def\pdfstartthread {\pdfextension startthread }
-\normalprotected\def\pdfendthread {\pdfextension endthread\relax}
-\normalprotected\def\pdfinfo {\pdfextension info }
-\normalprotected\def\pdfcatalog {\pdfextension catalog }
-\normalprotected\def\pdfnames {\pdfextension names }
-\normalprotected\def\pdfincludechars {\pdfextension includechars }
-\normalprotected\def\pdffontattr {\pdfextension fontattr }
-\normalprotected\def\pdfmapfile {\pdfextension mapfile }
-\normalprotected\def\pdfmapline {\pdfextension mapline }
-\normalprotected\def\pdftrailer {\pdfextension trailer }
-\normalprotected\def\pdfglyphtounicode {\pdfextension glyphtounicode }
-
-% \chardef\pdfnofullbanner = 1
-% \chardef\pdfnofilename = 2
-% \chardef\pdfnopagenumber = 4
-% \chardef\pdfnoinfodict = 8
-% \chardef\pdfnocreator = 16
-% \chardef\pdfnocreationdate = 32
-% \chardef\pdfnomoddate = 64
-% \chardef\pdfnoproducer = 128
-% \chardef\pdfnotrapped = 256
-% \chardef\pdfnoid = 512
-
-\def\pdftexversion {\numexpr\pdffeedback version\relax}
-\def\pdftexrevision {\pdffeedback revision}
-\def\pdflastlink {\numexpr\pdffeedback lastlink\relax}
-\def\pdfretval {\numexpr\pdffeedback retval\relax}
-\def\pdflastobj {\numexpr\pdffeedback lastobj\relax}
-\def\pdflastannot {\numexpr\pdffeedback lastannot\relax}
-\def\pdfxformname {\numexpr\pdffeedback xformname\relax}
-\def\pdfcreationdate {\pdffeedback creationdate}
-\def\pdffontname {\numexpr\pdffeedback fontname\relax}
-\def\pdffontobjnum {\numexpr\pdffeedback fontobjnum\relax}
-\def\pdffontsize {\dimexpr\pdffeedback fontsize\relax}
-\def\pdfpageref {\numexpr\pdffeedback pageref\relax}
-\def\pdfcolorstackinit {\pdffeedback colorstackinit}
-
-\let\pdfxform \saveboxresource
-\let\pdflastxform \lastsavedboxresourceindex
-\let\pdfrefxform \useboxresource
-\let\pdfximage \saveimageresource
-\let\pdflastximage \lastsavedimageresourceindex
-\let\pdflastximagepages \lastsavedimageresourcepages
-\let\pdfrefximage \useimageresource
-\let\pdfsavepos \savepos
-\let\pdflastxpos \lastxpos
-\let\pdflastypos \lastypos
-
-\edef\pdfcompresslevel {\pdfvariable compresslevel} \pdfcompresslevel \plusnine
-\edef\pdfobjcompresslevel {\pdfvariable objcompresslevel} \pdfobjcompresslevel \plusone
-%edef\pdfrecompress {\pdfvariable recompress} \pdfrecompress \zerocount
-\edef\pdfdecimaldigits {\pdfvariable decimaldigits} \pdfdecimaldigits \plussix % \plusfive
-\edef\pdfgamma {\pdfvariable gamma} \pdfgamma \plusthousand
-\edef\pdfimageresolution {\pdfvariable imageresolution} \pdfimageresolution 300
-\edef\pdfimageapplygamma {\pdfvariable imageapplygamma} \pdfimageapplygamma \zerocount
-\edef\pdfimagegamma {\pdfvariable imagegamma} \pdfimagegamma 2200
-\edef\pdfimagehicolor {\pdfvariable imagehicolor} \pdfimagehicolor \plusone
-\edef\pdfimageaddfilename {\pdfvariable imageaddfilename} \pdfimageaddfilename \plusone
-\edef\pdfpkresolution {\pdfvariable pkresolution} \pdfpkresolution 1200
-\edef\pdfinclusioncopyfonts {\pdfvariable inclusioncopyfonts} \pdfinclusioncopyfonts \plusone
-\edef\pdfinclusionerrorlevel {\pdfvariable inclusionerrorlevel} \pdfinclusionerrorlevel \zerocount
-\edef\pdfgentounicode {\pdfvariable gentounicode} \pdfgentounicode \plusone
-\edef\pdfomitcidset {\pdfvariable omitcidset } \pdfomitcidset \plusone
-\edef\pdfomitcharset {\pdfvariable omitcharset} \pdfomitcharset \plusone
-\edef\pdfpagebox {\pdfvariable pagebox} \pdfpagebox \zerocount
-\edef\pdfmajorversion {\pdfvariable majorversion} % \pdfmajorversion \plusone
-\edef\pdfminorversion {\pdfvariable minorversion} \pdfminorversion \plusseven
-\edef\pdfuniqueresname {\pdfvariable uniqueresname} \pdfuniqueresname \zerocount
-\edef\pdfhorigin {\pdfvariable horigin} \pdfhorigin 1in
-\edef\pdfvorigin {\pdfvariable vorigin} \pdfvorigin \pdfhorigin
-\edef\pdflinkmargin {\pdfvariable linkmargin} \pdflinkmargin \zeropoint
-\edef\pdfdestmargin {\pdfvariable destmargin} \pdfdestmargin \zeropoint
-\edef\pdfthreadmargin {\pdfvariable threadmargin} \pdfthreadmargin \zeropoint
-\edef\pdfxformmargin {\pdfvariable xformmargin} \pdfxformmargin \zeropoint
-\edef\pdfpkfixeddpi {\pdfvariable pkfixeddpi} \pdfpkfixeddpi \plusone
-\edef\pdfignoreunknownimages {\pdfvariable ignoreunknownimages} \pdfignoreunknownimages \zerocount
-
-\edef\pdfpagesattr {\pdfvariable pagesattr}
-\edef\pdfpageattr {\pdfvariable pageattr}
-\edef\pdfpageresources {\pdfvariable pageresources}
-\edef\pdfxformattr {\pdfvariable xformattr}
-\edef\pdfxformresources {\pdfvariable xformresources}
-\edef\pdfpkmode {\pdfvariable pkmode}
-
-\edef\pdfsuppressoptionalinfo{\pdfvariable suppressoptionalinfo }
-\edef\pdftrailerid {\pdfvariable trailerid }
-\edef\pdfinfoomitdate {\pdfvariable suppressoptionalinfo \numexpr32+64\relax}
-
-\normalprotected\def\nopdfcompression {\pdfobjcompresslevel\zerocount \pdfcompresslevel\zerocount}
-\normalprotected\def\maximumpdfcompression{\pdfobjcompresslevel\plusnine \pdfcompresslevel\plusnine }
-\normalprotected\def\normalpdfcompression {\pdfobjcompresslevel\plusthree \pdfcompresslevel\plusthree}
-
-\else
- \let\nopdfcompression \relax
- \let\maximumpdfcompression\relax
- \let\normalpdfcompression \relax
+\ifdefined\pdfvariable
+
+ \pdfvariable compresslevel \plusthree
+ \pdfvariable objcompresslevel \plusone
+ % \pdfvariable recompress \zerocount
+ \pdfvariable decimaldigits \plussix
+ \pdfvariable gamma \plusthousand
+ \pdfvariable imageresolution 300
+ \pdfvariable imageapplygamma \zerocount
+ \pdfvariable imagegamma 2200
+ \pdfvariable imagehicolor \plusone
+ \pdfvariable imageaddfilename \plusone
+ \pdfvariable pkresolution 1200
+ \pdfvariable inclusioncopyfonts \plusone
+ \pdfvariable inclusionerrorlevel \zerocount
+ \pdfvariable gentounicode \plusone
+ \pdfvariable omitcidset \plusone
+ \pdfvariable omitcharset \plusone
+ \pdfvariable pagebox \zerocount
+ % \pdfvariable majorversion % \plusone
+ \pdfvariable minorversion \plusseven
+ \pdfvariable uniqueresname \zerocount
+ \pdfvariable horigin 1in
+ \pdfvariable vorigin 1in
+ % \pdfvariable linkmargin \zeropoint
+ % \pdfvariable destmargin \zeropoint
+ % \pdfvariable threadmargin \zeropoint
+ % \pdfvariable xformmargin \zeropoint
+ \pdfvariable pkfixeddpi \plusone
+ \pdfvariable ignoreunknownimages \zerocount
+
\fi
-\normalpdfcompression
+\let\nopdfcompression \relax
+\let\onlypdfobjectcompression\relax
+\let\maximumpdfcompression \relax
+\let\normalpdfcompression \relax
\ifdefined\outputmode
\outputmode \zerocount % we generate the format in this mode