%D \module
%D   [       file=mult-sys,
%D        version=1996.06.01,
%D          title=\CONTEXT\ Multilingual Macros,
%D       subtitle=System,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D In boring module we define a lot of obscure but useful system constants.
%D By doing so we save lots of memory while at the same time we prevent
%D ourself making typing errors.

\writestatus{loading}{ConTeXt Multilingual Macros / System}

\unprotect

%D This file is mostly the same as the \MKII\ variant but we keep extending
%D \MKIV, so it was bout time to have a dedicated variant.
%D
%D The constants are grouped in such a way that there is a minimal change of
%D conflicts.
%D
%D \starttyping
%D \definesystemconstants {word}
%D \definemessageconstant {word}
%D \stoptyping
%D
%D This commands generate \type{\s!word} and \type{\m!word}.

\definesystemconstant {hans}
\definesystemconstant {taco}

%D First we define some system constants used for both the multi||lingual
%D interface and multi||linguag typesetting.

\definesystemconstant {afrikaans}    \definesystemconstant {af}
\definesystemconstant {arabic}       \definesystemconstant {ar}
\definesystemconstant {catalan}      \definesystemconstant {ca}
\definesystemconstant {chinese}      \definesystemconstant {cn}
\definesystemconstant {croatian}     \definesystemconstant {hr}
\definesystemconstant {czech}        \definesystemconstant {cs}
                                     \definesystemconstant {cz}
\definesystemconstant {danish}       \definesystemconstant {da}
\definesystemconstant {dutch}        \definesystemconstant {nl}
\definesystemconstant {english}      \definesystemconstant {en}
\definesystemconstant {finish}       \definesystemconstant {fi}
\definesystemconstant {french}       \definesystemconstant {fr}
\definesystemconstant {german}       \definesystemconstant {de}
\definesystemconstant {hungarian}    \definesystemconstant {hu}
\definesystemconstant {italian}      \definesystemconstant {it}
\definesystemconstant {latin}        \definesystemconstant {la}
\definesystemconstant {lithuanian}   \definesystemconstant {lt}
\definesystemconstant {bokmal}       \definesystemconstant {nb}
\definesystemconstant {norwegian}    \definesystemconstant {no}
\definesystemconstant {nynorsk}      \definesystemconstant {nn}
\definesystemconstant {polish}       \definesystemconstant {pl}
\definesystemconstant {persian}      \definesystemconstant {pe}
\definesystemconstant {portuguese}   \definesystemconstant {pt}
\definesystemconstant {romanian}     \definesystemconstant {ro}
\definesystemconstant {russian}      \definesystemconstant {ru}
\definesystemconstant {slovak}       \definesystemconstant {sk}
\definesystemconstant {slovenian}    \definesystemconstant {sl}
\definesystemconstant {slovene}      % obsolete
\definesystemconstant {spanish}      \definesystemconstant {es}
\definesystemconstant {swedish}      \definesystemconstant {sv}
\definesystemconstant {turkish}      \definesystemconstant {tr}
\definesystemconstant {turkmen}      \definesystemconstant {tk}
\definesystemconstant {gbenglish}    \definesystemconstant {gb}
\definesystemconstant {ukenglish}    \definesystemconstant {uk}
\definesystemconstant {usenglish}    \definesystemconstant {us}
\definesystemconstant {ukrainian}    \definesystemconstant {ua}
\definesystemconstant {greek}        \definesystemconstant {gr}
\definesystemconstant {ancientgreek} \definesystemconstant {agr}
\definesystemconstant {vietnamese}   \definesystemconstant {vi}
                                     \definesystemconstant {vn}
\definesystemconstant {chinese}      \definesystemconstant {cn}
\definesystemconstant {japanese}     \definesystemconstant {ja}
\definesystemconstant {korean}       \definesystemconstant {kr}

%D For proper \UNICODE\ support we need a few font related constants.

\definesystemconstant {BoldItalic}
\definesystemconstant {BoldSlanted}
\definesystemconstant {Bold}
\definesystemconstant {Italic}
\definesystemconstant {Regular}
\definesystemconstant {Slanted}
\definesystemconstant {Unicode}

\definesystemconstant {Handwriting}
\definesystemconstant {Calligraphy}
\definesystemconstant {Casual}

\definesystemconstant {Regular}
\definesystemconstant {Support}
\definesystemconstant {Type}

\definesystemconstant {Math}     % not used
\definesystemconstant {MathBold} % not used

\definesystemconstant {MathRoman}
\definesystemconstant {MathRomanBold}

\definesystemconstant {Serif}
\definesystemconstant {SerifBold}
\definesystemconstant {SerifItalic}
\definesystemconstant {SerifBoldItalic}
\definesystemconstant {SerifSlanted}
\definesystemconstant {SerifBoldSlanted}
\definesystemconstant {SerifCaps}
%definesystemconstant {SerifCapsSlanted}

\definesystemconstant {Sans}
\definesystemconstant {SansBold}
\definesystemconstant {SansItalic}
\definesystemconstant {SansBoldItalic}
\definesystemconstant {SansSlanted}
\definesystemconstant {SansBoldSlanted}
\definesystemconstant {SansCaps}
% \definesystemconstant {SansCapsSlanted}

\definesystemconstant {Mono}
\definesystemconstant {MonoBold}
\definesystemconstant {MonoItalic}
\definesystemconstant {MonoBoldItalic}
\definesystemconstant {MonoSlanted}
\definesystemconstant {MonoBoldSlanted}
\definesystemconstant {MonoCaps}
% \definesystemconstant {MonoCapsSlanted}
% \definesystemconstant {MonoVariable}

\definesystemconstant {DefaultFont}

\definesystemconstant {Simple}
\definesystemconstant {Normal}
\definesystemconstant {Caps}

\definesystemconstant {serif}
\definesystemconstant {sans}
\definesystemconstant {mono}
\definesystemconstant {math}
\definesystemconstant {handwriting}
\definesystemconstant {calligraphy}
\definesystemconstant {casual}
\definesystemconstant {fax}

\definesystemconstant {fallback}

%definesystemconstant {mnem} % kind of generic short tag

\definesystemconstant {otr}
\definesystemconstant {box}

\definesystemconstant {file}
\definesystemconstant {name}
\definesystemconstant {spec}

\definesystemconstant {both}

\definesystemconstant {attribute}

\definesystemconstant {none}
\definesystemconstant {auto}
\definesystemconstant {default}
\definesystemconstant {smallcaps}

\definesystemconstant {regular}
\definesystemconstant {script}
\definesystemconstant {fraktur}
\definesystemconstant {blackboard}

\definesystemconstant {mi} % maybe some day a special default vector
\definesystemconstant {tf}
\definesystemconstant {sl}
\definesystemconstant {it}
\definesystemconstant {bf}
\definesystemconstant {bs}
\definesystemconstant {bi}

\definesystemconstant {rm}
\definesystemconstant {ss}
\definesystemconstant {tt}
\definesystemconstant {hw}
\definesystemconstant {cg}
\definesystemconstant {mm}

\definesystemconstant {x}
\definesystemconstant {xx}
\definesystemconstant {em}

\definesystemconstant {a}
\definesystemconstant {b}
\definesystemconstant {c}
\definesystemconstant {d}
\definesystemconstant {e}
\definesystemconstant {f}

\definesystemconstant {mr}
\definesystemconstant {mb}
\definesystemconstant {mrlr}
\definesystemconstant {mrrl}
\definesystemconstant {mblr}
\definesystemconstant {mbrl}

\definesystemconstant {tf}
\definesystemconstant {bf}
\definesystemconstant {bs}
\definesystemconstant {bi}
\definesystemconstant {sl}
\definesystemconstant {it}
\definesystemconstant {sc}

\definesystemconstant {small}
\definesystemconstant {big}

\definesystemconstant {first}
\definesystemconstant {second}
\definesystemconstant {third}

%D Next come some \CONTEXT\ constants, used in the definition of private commands:

\definesystemconstant {tex}
\definesystemconstant {xml}
\definesystemconstant {lua}

\definesystemconstant {next}
\definesystemconstant {pickup}
\definesystemconstant {ascii}
\definesystemconstant {default}
\definesystemconstant {unknown}
\definesystemconstant {action}
\definesystemconstant {compare}
\definesystemconstant {do}
\definesystemconstant {dodo}
\definesystemconstant {complex}
\definesystemconstant {simple}
\definesystemconstant {start}
\definesystemconstant {stop}
\definesystemconstant {dummy}
\definesystemconstant {local}
\definesystemconstant {global}
\definesystemconstant {done}
\definesystemconstant {font}
\definesystemconstant {link}
\definesystemconstant {parent}
\definesystemconstant {child}
\definesystemconstant {clone}
\definesystemconstant {section}
\definesystemconstant {handler}
\definesystemconstant {counter}
\definesystemconstant {single}
\definesystemconstant {multi}
\definesystemconstant {indeed}

% \def\s!parent{->} % 1% faster / => does not work in assignments
% \def\s!child {<-} % 1% faster / <= does not work in assignments

\definesystemconstant {hasnumber}
\definesystemconstant {hastitle}
\definesystemconstant {hascaption}
\definesystemconstant {haslevel}
\definesystemconstant {hasparent}
\definesystemconstant {hassuffix}

\definesystemconstant {mkiv}
\definesystemconstant {mkii}

\definesystemconstant {normal}
\definesystemconstant {bold}
\definesystemconstant {italic}
\definesystemconstant {slanted}

\definesystemconstant {default}
\definesystemconstant {smallcaps}

\definesystemconstant {run}

\definesystemconstant {mode}
\definesystemconstant {setup}
\definesystemconstant {environment}
\definesystemconstant {document}

%definesystemconstant {fam}
\definesystemconstant {display}
\definesystemconstant {text}
\definesystemconstant {script}
\definesystemconstant {scriptscript}
\definesystemconstant {uncramped}
\definesystemconstant {cramped}

\definesystemconstant {lefthyphenmin}
\definesystemconstant {righthyphenmin}
\definesystemconstant {lefthyphenchar}
\definesystemconstant {righthyphenchar}

%definesystemconstant {skewchar}
%definesystemconstant {hyphenchar}
\definesystemconstant {catcodes}
%definesystemconstant {encoding}
%definesystemconstant {entities}
%definesystemconstant {resource}
\definesystemconstant {mapping}
\definesystemconstant {language}
\definesystemconstant {patterns}
\definesystemconstant {rname}
\definesystemconstant {rscale}
%definesystemconstant {handling}
\definesystemconstant {features}
\definesystemconstant {direction}
\definesystemconstant {fallbacks}
\definesystemconstant {goodies}
\definesystemconstant {designsize}
%definesystemconstant {background}
%definesystemconstant {ucmap}

%definesystemconstant {property}
%definesystemconstant {overprint}
%definesystemconstant {layer}
\definesystemconstant {effect}                 % todo s
%definesystemconstant {negative}
%definesystemconstant {color}
%definesystemconstant {transparency}

\definesystemconstant {black}
\definesystemconstant {white}

\definesystemconstant {system} % not yet interfaces messages
\definesystemconstant {user}
\definesystemconstant {check}
\definesystemconstant {reset}
\definesystemconstant {set}
\definesystemconstant {empty}

\definesystemconstant {realpage}
\definesystemconstant {userpage}
\definesystemconstant {subpage}

\definesystemconstant {page}
\definesystemconstant {subpage}
\definesystemconstant {leftpage}
\definesystemconstant {rightpage}
\definesystemconstant {somewhere}

\definesystemconstant {userdata}
\definesystemconstant {command}
\definesystemconstant {simple}

\definesystemconstant {full}
\definesystemconstant {text}
\definesystemconstant {paragraph}
\definesystemconstant {margintext}
\definesystemconstant {line}

\definesystemconstant {number}
\definesystemconstant {symbol}
\definesystemconstant {format}
\definesystemconstant {data}
\definesystemconstant {float}
\definesystemconstant {extensions}
\definesystemconstant {initializations}

\definesystemconstant {rgb}
\definesystemconstant {cmyk}
\definesystemconstant {gray}
\definesystemconstant {spot}
\definesystemconstant {all}
\definesystemconstant {dtp}
\definesystemconstant {none}

\definesystemconstant {map}
\definesystemconstant {special}
\definesystemconstant {size}

\definesystemconstant {depth}
\definesystemconstant {nodepth}

%D Just to be complete we define the standard \TEX\ units.

\definesystemconstant {cm}
\definesystemconstant {em}
\definesystemconstant {ex}
\definesystemconstant {mm}
\definesystemconstant {pt}
\definesystemconstant {sp}
\definesystemconstant {bp}
\definesystemconstant {in}
\definesystemconstant {pc}
\definesystemconstant {dd}
\definesystemconstant {cc}
\definesystemconstant {nd}
\definesystemconstant {nc}

%D As the name of their define command states, the next set of constants is used in
%D the message macro's.

\definemessageconstant {check}
\definemessageconstant {colors}
\definemessageconstant {columns}
\definemessageconstant {regimes}
\definemessageconstant {figures}
\definemessageconstant {fields}
\definemessageconstant {files}
\definemessageconstant {floatblocks}
\definemessageconstant {fonts}
\definemessageconstant {handlings}
\definemessageconstant {interactions}
\definemessageconstant {javascripts}
\definemessageconstant {layouts}
\definemessageconstant {languages}
\definemessageconstant {references}
\definemessageconstant {structures}
\definemessageconstant {symbols}
\definemessageconstant {system}
\definemessageconstant {lua}
\definemessageconstant {textblocks}
\definemessageconstant {verbatims}
\definemessageconstant {versions}
\definemessageconstant {metapost}
\definemessageconstant {chemicals}
\definemessageconstant {publications}

%D When we use numbers and dimensions the same applies as with the keywords like
%D \type {width} and \type {plus} mentioned earlier.

\def\!!ten                   {10}
\def\!!twelve                {12}
\def\!!hundred              {100}
\def\!!thousand            {1000}
\def\!!tenthousand        {10000}
\def\!!maxcard            {65536}
\def\!!medcard            {32768}

\def\!!zeropoint            {0pt}
\def\!!onepoint             {1pt}
\def\!!twopoint             {2pt}
\def\!!threepoint           {3pt}
\def\!!fourpoint            {4pt}
\def\!!fivepoint            {5pt}
\def\!!sixpoint             {6pt}
\def\!!sevenpoint           {7pt}
\def\!!eightpoint           {8pt}
\def\!!ninepoint            {9pt}
\def\!!tenpoint            {10pt}
\def\!!elevenpoint         {11pt}
\def\!!twelvepoint         {12pt}
\def\!!fourteenpointfour {14.4pt}

\def\!!plustoken              {+}
\def\!!minustoken             {-}

\def\__unknown__    {\string\\//} % unlikely value

%D Variables are composed of a command specific tag and a user supplied variable
%D (system constant). The tag \type {du} for instance is available as \type {\??du}
%D and expands to \type {@@du} in composed variables.

\definesystemvariable {du}   % dummy, will stay

% bibl:

\definesystemvariable {pv}   % PublicationVariable
\definesystemvariable {pb}   % PuBlication

% needs checking (namespaces now)

\definesystemvariable {fw}   % simpleFonts by Wolfgang

% old pragma

\definesystemvariable {kt}   % KonTakten
\definesystemvariable {kw}   % KontaktWaarde
\definesystemvariable {st}   % STickers
\definesystemvariable {km}   % KenMerk

% mkii

\definesystemvariable {xf}   % XML File (xtag)
\definesystemvariable {xp}   % XML Processing (xtag, so still needed)
\definesystemvariable {fo}   % xml FO (xtag)
\definesystemvariable {fx}   % FoXet

% mkiv

%D Next we define some language independant one letter variables and keywords. We can
%D actually make these system variables.

\defineinterfaceconstant {x} {x}
\defineinterfaceconstant {y} {y}
\defineinterfaceconstant {w} {w}
\defineinterfaceconstant {h} {h}
\defineinterfaceconstant {s} {s}
\defineinterfaceconstant {t} {t}

\defineinterfaceconstant {a} {a} % can go
\defineinterfaceconstant {b} {b} % can go
\defineinterfaceconstant {c} {c} % can go
\defineinterfaceconstant {d} {d} % can go
\defineinterfaceconstant {e} {e} % can go
\defineinterfaceconstant {f} {f} % can go

\defineinterfaceconstant {s} {s}
\defineinterfaceconstant {r} {r}
\defineinterfaceconstant {g} {g}
\defineinterfaceconstant {b} {b}
\defineinterfaceconstant {c} {c}
\defineinterfaceconstant {m} {m}
\defineinterfaceconstant {y} {y}
\defineinterfaceconstant {k} {k}
\defineinterfaceconstant {a} {a} % alternative
\defineinterfaceconstant {t} {t} % transparency
\defineinterfaceconstant {p} {p} % percentage
\defineinterfaceconstant {h} {h}
\defineinterfaceconstant {s} {s}
\defineinterfaceconstant {v} {v}

\defineinterfaceconstant {rgb}  {rgb}
\defineinterfaceconstant {cmyk} {cmyk}
\defineinterfaceconstant {mp}   {mp}

\defineinterfacevariable {rgb}  {rgb}
\defineinterfacevariable {cmyk} {cmyk}
\defineinterfacevariable {mp}   {mp}

\defineinterfacevariable {s} {s}

\defineinterfacevariable {a} {a}
\defineinterfacevariable {b} {b}
\defineinterfacevariable {c} {c}
\defineinterfacevariable {d} {d}

%D Special purpose variables:

\def\v!oddeven#1{\ifodd#1\v!odd\else\v!even\fi}

%D The names of files and their extensions are fixed. \CONTEXT\ uses as less
%D files as possible. Utility files can be recognized by the first two
%D characters of the extension: \type {tu}.

%definefileconstant {utilityfilename}    {texutil}
%definefileconstant {blockextension}     {tub}
%definefileconstant {figureextension}    {tuf}
%definefileconstant {inputextension}     {tui}
%definefileconstant {outputextension}    {tuo} % tup for previous run
%definefileconstant {optionextension}    {top}
%definefileconstant {temporaryextension} {tmp}
%definefileconstant {patternsextension}  {pat}
%definefileconstant {hyphensextension}   {hyp}
%definefileconstant {fontmapextension}   {map}
\definefileconstant {bibextension}       {bbl}

%D These files are loaded at start||up. They may contain system specific setups (or
%D calls to other files), old macro's, to garantee compatibility and new macro's noy
%D yet present in the format.

\definefileconstant {errfilename} {cont-err}
\definefileconstant {sysfilename} {cont-sys}
\definefileconstant {newfilename} {cont-new}
\definefileconstant {locfilename} {cont-loc}
\definefileconstant {expfilename} {cont-exp}

%D The setup files for the language, font, color and special subsystems have a common
%D prefix. This means that we have at most three characters for unique filenames.

\definefileconstant {colorprefix}        {colo-}
%definefileconstant {encodingprefix}     {enco-}
%definefileconstant {filterprefix}       {filt-}
\definefileconstant {fontprefix}         {font-}
%definefileconstant {handlingprefix}     {hand-}
%definefileconstant {javascriptprefix}   {java-}
%definefileconstant {languageprefix}     {lang-}
%definefileconstant {mathprefix}         {math-}
%definefileconstant {metapostprefix}     {meta-}
%definefileconstant {regimeprefix}       {regi-}
%definefileconstant {specialprefix}      {spec-}
\definefileconstant {symbolprefix}       {symb-}
\definefileconstant {typeprefix}         {type-}
%definefileconstant {xtagprefix}         {xtag-}
%definefileconstant {propprefix}         {prop-}
%definefileconstant {unicprefix}         {unic-}
%definefileconstant {sortprefix}         {sort-}
%definefileconstant {prettyprefix}       {pret-}

%definefileconstant {moduleprefix}       {m-}
%definefileconstant {styleprefix}        {s-}
%definefileconstant {xstyleprefix}       {x-}
%definefileconstant {privateprefix}      {p-}
%definefileconstant {thirdprefix}        {t-}

%definefileconstant {beforeprefix}       {b-}
%definefileconstant {afterprefix}        {a-}

% for old times sake:

% \defineinterfaceconstant {x}  {x}
% \defineinterfaceconstant {xx} {xx}
% \defineinterfaceconstant {em} {em} % will go

% \defineinterfaceconstant {tf} {tf}
% \defineinterfaceconstant {bf} {bf}
% \defineinterfaceconstant {bs} {bs}
% \defineinterfaceconstant {bi} {bi}
% \defineinterfaceconstant {sl} {sl}
% \defineinterfaceconstant {it} {it}
% \defineinterfaceconstant {sc} {sc} % keep, used elsewhere (or define in mult-def)

%D For figure inclusion we need(ed):

%defineinterfaceconstant {tif}  {tif}
%defineinterfaceconstant {eps}  {eps}
%defineinterfaceconstant {mps}  {mps}
%defineinterfaceconstant {jpg}  {jpg}
%defineinterfaceconstant {pdf}  {pdf}
%defineinterfaceconstant {png}  {png}
%defineinterfaceconstant {avi}  {avi}
%defineinterfaceconstant {mov}  {mov}
%defineinterfaceconstant {svg}  {svg}
\defineinterfaceconstant {tex}  {tex} % Also gone?
%defineinterfaceconstant {tmp}  {tmp}
%defineinterfaceconstant {cld}  {cld}

%D A careful reader will have noticed that in the module \type {mult-ini} we defined
%D \type {\selectinterface}. We were not yet able to actually select an interface,
%D because we still had to define the constants and variables. Now we've done so,
%D selection is permitted.

\selectinterface

%D Ok, here are some more, because we've got ouselves some extensions to \CONTEXT.

\definemessageconstant {addresses}
\definemessageconstant {documents}

%D Nicer than being undefined:

\let\p_align     \empty
\let\p_aligntitle\empty
\let\p_continue  \empty
\let\p_footer    \empty
\let\p_label     \empty
\let\p_number    \empty
\let\p_page      \empty
\let\p_state     \empty
\let\p_strut     \empty
\let\p_text      \empty
\let\p_tolerance \empty

% more will follow

\protect \endinput
