summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/attr-lay.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/attr-lay.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/attr-lay.mkiv47
1 files changed, 20 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/context/base/attr-lay.mkiv b/Master/texmf-dist/tex/context/base/attr-lay.mkiv
index b1f3c944e46..67cd204e2f6 100644
--- a/Master/texmf-dist/tex/context/base/attr-lay.mkiv
+++ b/Master/texmf-dist/tex/context/base/attr-lay.mkiv
@@ -5,7 +5,7 @@
%D subtitle=Viewerlayers,
%D author=Hans Hagen,
%D date=\currentdate,
-%D copyright=PRAGMA-ADE]
+%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
@@ -15,21 +15,14 @@
\unprotect
-\def\c!printable{printable} % todo
-
\registerctxluafile{attr-lay}{1.001}
% needs to work over stopitemize grouping etc
-\def\registerviewerlayer#1#2% global !
- {\setxvalue{(vl:#1)}{\global\attribute\viewerlayerattribute\ctxlua{tex.write(attributes.viewerlayers.register('#2'))} }}
-
-\setevalue{(vl:)}{\global\attribute\viewerlayerattribute\attributeunsetvalue}
-
-\def\dotriggerviewerlayer % move to lua
- {\ctxlua{attributes.viewerlayers.enable()}%
- \gdef\dotriggerviewerlayer##1{\csname(vl:##1)\endcsname}%
- \dotriggerviewerlayer}
+% \def\registerviewerlayer#1#2% global !
+% {\setxvalue{\??ql:#1}{\global\attribute\viewerlayerattribute\ctxlua{tex.write(attributes.viewerlayers.register('#2'))} }}
+%
+% \setevalue{\??ql:}{\global\attribute\viewerlayerattribute\attributeunsetvalue}
\getparameters
[\??lr]
@@ -58,8 +51,8 @@
\setugvalue{\e!stop #1}{\stopviewerlayer }}%
\endgroup}
-\unexpanded\def\startviewerlayer[#1]{\ctxlua{attributes.viewerlayers.start("#1")}} % not grouped
-\unexpanded\def\stopviewerlayer {\ctxlua{attributes.viewerlayers.stop()}} % not grouped
+\unexpanded\def\startviewerlayer[#1]{\ctxcommand{startviewerlayer("#1")}} % not grouped
+\unexpanded\def\stopviewerlayer {\ctxcommand{stopviewerlayer()}} % not grouped
\unexpanded\def\viewerlayer [#1]{\groupedcommand{\startviewerlayer[#1]}{\stopviewerlayer}} % grouped
% some day we will keep this at the lua end as the info is only needed there
@@ -70,36 +63,36 @@
\appendtoks
\let\currentviewerlayer\empty
-\to \everypagebody
+\to \everybeforepagebody
% layout components are implemented rather directly (speed)
-\def\doinitializelayoutcomponent#1#2%
- {\ctxcommand{defineviewerlayer{% this will move to the lua end i.e be merged with register
- tag = "#1:#2",
- title = "#1 #2",
+\def\doinitializelayoutcomponent#1%
+ {\edef\layoutcomponentboxattribute{\ctxcommand{definedviewerlayer{%
+ tag = "#1",
+ title = utilities.strings.nice("#1"), % only here as in steps we have step:<number>
visible = "\v!start",
editable = "\v!yes",
printable = "\v!yes"
- }}%
- \edef\layoutcomponentboxattribute{attr \viewerlayerattribute \ctxlua{tex.write(attributes.viewerlayers.register('#1:#2',true))}\relax}%
- \expandafter\glet\csname\??ly>#1:#2\endcsname\layoutcomponentboxattribute}
+ }}}%
+ \edef\layoutcomponentboxattribute{attr \viewerlayerattribute \layoutcomponentboxattribute\relax}%
+ \expandafter\glet\csname\??lr:a:#1\endcsname\layoutcomponentboxattribute}
-\def\dosetlayoutcomponentattribute#1#2% make this faster
- {\expandafter\let\expandafter\layoutcomponentboxattribute\csname\??ly>#1:#2\endcsname
+\def\dosetlayoutcomponentattribute#1% make this faster
+ {\expandafter\let\expandafter\layoutcomponentboxattribute\csname\??lr:a:#1\endcsname
\ifx\layoutcomponentboxattribute\relax
- \doinitializelayoutcomponent{#1}{#2}% get rid of { }
+ \doinitializelayoutcomponent{#1}% get rid of { }
\fi}
\def\doresetlayoutcomponentattribute
{\let\layoutcomponentboxattribute\empty}
-\let\setlayoutcomponentattribute \gobbletwoarguments
+\let\setlayoutcomponentattribute \gobbleoneargument
\let\resetlayoutcomponentattribute\relax
\let\layoutcomponentboxattribute \empty
\def\showlayoutcomponents
- {\ctxlua{attributes.viewerlayers.enable()}%
+ {\ctxlua{attributes.viewerlayers.enable()}% will go
\let\setlayoutcomponentattribute \dosetlayoutcomponentattribute
\let\resetlayoutcomponentattribute\doresetlayoutcomponentattribute}