[latex3-commits] [git/LaTeX3-latex3-pdfresources] main: use kernel hooks (477aba8)
Ulrike Fischer
fischer at troubleshooting-tex.de
Mon Feb 22 00:03:22 CET 2021
Repository : https://github.com/latex3/pdfresources
On branch : main
Link : https://github.com/latex3/pdfresources/commit/477aba8ddd11978c6d681e4957ffaa67475f2e4c
>---------------------------------------------------------------
commit 477aba8ddd11978c6d681e4957ffaa67475f2e4c
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Mon Feb 22 00:03:22 2021 +0100
use kernel hooks
>---------------------------------------------------------------
477aba8ddd11978c6d681e4957ffaa67475f2e4c
l3backend-testphase.dtx | 27 +++++++++++----------------
l3pdfmanagement.dtx | 20 ++++++++++----------
testfiles-dvips/pagelabels-log.tlg | 2 +-
testfiles-dvips/show.tlg | 2 +-
4 files changed, 23 insertions(+), 28 deletions(-)
diff --git a/l3backend-testphase.dtx b/l3backend-testphase.dtx
index 71b8678..abd69ec 100644
--- a/l3backend-testphase.dtx
+++ b/l3backend-testphase.dtx
@@ -151,29 +151,24 @@
% \begin{macrocode}
%<*pdftex|luatex>
% put in \@kernel at after@enddocument at afterlastpage
-\hook_gput_code:nnn {enddocument/afterlastpage}
- {pdf/endrun}
+\tl_gput_right:Nn \@kernel at after@enddocument at afterlastpage
{
- \hook_use:n {pdf/management/end_run}
+ \g__kernel_pdfmanagement_end_run_code_tl
}
%</pdftex|luatex>
%<*dvipdfmx|xdvipdfmx>
% put in \@kernel at after@shipout at lastpage
-\hook_gput_code:nnn {shipout/lastpage}
- {pdf/endrun}
+\tl_gput_right:Nn \@kernel at after@shipout at lastpage
{
- \hook_use:n {pdf/management/end_run}
+ \g__kernel_pdfmanagement_end_run_code_tl
}
-\hook_gset_rule:nnnn {shipout/lastpage}{pdf}{before}{pdf/endrun}
%</dvipdfmx|xdvipdfmx>
%<*dvips>
% put in \@kernel at after@shipout at lastpage
-\hook_gput_code:nnn {shipout/lastpage}
- {pdf/endrun}
+\tl_gput_right:Nn\@kernel at after@shipout at lastpage
{
- \hook_use:n {pdf/management/end_run}
+ \g__kernel_pdfmanagement_end_run_code_tl
}
-\hook_gset_rule:nnnn {shipout/lastpage}{pdf}{before}{pdf/endrun}
%</dvips>
% \end{macrocode}
% \subsubsection{Add the \enquote{shipout} hooks}
@@ -188,21 +183,21 @@
\g at addto@macro \@kernel at before@shipout at background{\relax}
\g at addto@macro \@kernel at after@shipout at background
{
- \hook_use:n {pdf/management/thispage_shipout}
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
}
- \g at addto@macro \@kernel at after@shipout at lastpage
+ \tl_gput_left:Nn\@kernel at after@shipout at lastpage
{
- \hook_use:n {pdf/management/lastpage_shipout}
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
}
}
{
\hook_gput_code:nnn{shipout/background}{pdf}
{
- \hook_use:n {pdf/management/thispage_shipout}
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
}
\hook_gput_code:nnn {shipout/lastpage} {pdf}
{
- \hook_use:n {pdf/management/lastpage_shipout}
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
}
}
diff --git a/l3pdfmanagement.dtx b/l3pdfmanagement.dtx
index 13b11cc..411eae4 100644
--- a/l3pdfmanagement.dtx
+++ b/l3pdfmanagement.dtx
@@ -651,19 +651,19 @@
%
% \begin{variable}
% {
-% pdf/management/end_run,
-% pdf/management/lastpage_shipout,
-% pdf/management/thispage_shipout
+% \g__kernel_pdfmanagement_thispage_shipout_code_tl
+% \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+% \g__kernel_pdfmanagement_end_run_code_tl
% }
-% This hooks contain the code run in the three places.
+% This variables contain the code run in the three places.
% \begin{macrocode}
-\hook_new:n {pdf/management/end_run}
-\hook_new:n {pdf/management/lastpage_shipout}
-\hook_new:n {pdf/management/thispage_shipout}
+\tl_new:N \g__kernel_pdfmanagement_thispage_shipout_code_tl
+\tl_new:N \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+\tl_new:N \g__kernel_pdfmanagement_end_run_code_tl
% \end{macrocode}
% \end{variable}
% \begin{macrocode}
-\hook_gput_code:nnn {pdf/management/thispage_shipout} {pdf}
+\tl_gset:Nn \g__kernel_pdfmanagement_thispage_shipout_code_tl
{
\bool_if:NT \g_@@_active_bool
{
@@ -672,7 +672,7 @@
}
}
-\hook_gput_code:nnn {pdf/management/lastpage_shipout} {pdf}
+\tl_gset:Nn \g__kernel_pdfmanagement_lastpage_shipout_code_tl
{
\bool_if:NT \g_@@_active_bool
{
@@ -680,7 +680,7 @@
}
}
-\hook_gput_code:nnn {pdf/management/end_run} {pdf}
+\tl_gset:Nn \g__kernel_pdfmanagement_end_run_code_tl
{
\bool_if:NT \g_@@_active_bool
{
diff --git a/testfiles-dvips/pagelabels-log.tlg b/testfiles-dvips/pagelabels-log.tlg
index 2948a4e..5f5fd98 100644
--- a/testfiles-dvips/pagelabels-log.tlg
+++ b/testfiles-dvips/pagelabels-log.tlg
@@ -320,6 +320,7 @@ Completed box being shipped out [5]
.\kern 0.0
.\kern -633.0
.\hbox(0.0+0.0)x0.0
+..\special{PSfile=pagelabels-log.out.ps}
..\special{ps: [ /PAGES pdfmark}
..\special{ps:SDict begin mark/Creator <FEFF004C00610054006500580020007700690074\ETC.}
..\special{ps:SDict begin mark/CreationDate (D:20010101205959-00'00')/DOCINFO pd\ETC.}
@@ -328,6 +329,5 @@ Completed box being shipped out [5]
..\special{ps:SDict begin mark{Catalog}<</PageMode /UseOutlines>>/PUT pdfmark en\ETC.}
..\special{ps:SDict begin mark{Catalog}<</OpenAction [{Page1} /Fit]>>/PUT pdfmar\ETC.}
..\special{ps:SDict begin mark{Catalog}<</PageLabels <</Nums[0<</P(\376\377\003\\ETC.}
-..\special{PSfile=pagelabels-log.out.ps}
.\kern 633.0
(pagelabels-log.aux)
diff --git a/testfiles-dvips/show.tlg b/testfiles-dvips/show.tlg
index 112b5c5..64199cb 100644
--- a/testfiles-dvips/show.tlg
+++ b/testfiles-dvips/show.tlg
@@ -104,6 +104,7 @@ Completed box being shipped out [1]
.\kern 0.0
.\kern -633.0
.\hbox(0.0+0.0)x0.0
+..\special{PSfile=show.out.ps}
..\special{ps: [ /PAGES pdfmark}
..\special{ps:SDict begin mark/Creator <FEFF004C00610054006500580020007700690074\ETC.}
..\special{ps:SDict begin mark/CreationDate (D:20010101205959-00'00')/DOCINFO pd\ETC.}
@@ -112,6 +113,5 @@ Completed box being shipped out [1]
..\special{ps:SDict begin mark{Catalog}<</PageMode /UseOutlines>>/PUT pdfmark en\ETC.}
..\special{ps:SDict begin mark{Catalog}<</OpenAction [{Page1} /Fit]>>/PUT pdfmar\ETC.}
..\special{ps:SDict begin mark{Catalog}<</PageLabels <</Nums[0<</S/D>>]>>>>/PUT \ETC.}
-..\special{PSfile=show.out.ps}
.\kern 633.0
(show.aux)
More information about the latex3-commits
mailing list.