[latex3-commits] [git/LaTeX3-latex3-pdfresources] backendtest: cleaning (b8be1d2)

Ulrike Fischer fischer at troubleshooting-tex.de
Sun Aug 25 20:54:15 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : backendtest
Link       : https://github.com/latex3/pdfresources/commit/b8be1d2bcacb08a693857643abc254e96a507a9d

>---------------------------------------------------------------

commit b8be1d2bcacb08a693857643abc254e96a507a9d
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Aug 25 20:54:15 2019 +0200

    cleaning


>---------------------------------------------------------------

b8be1d2bcacb08a693857643abc254e96a507a9d
 pdfresources.dtx | 169 +++++++++++++++++++++++++++++--------------------------
 1 file changed, 88 insertions(+), 81 deletions(-)

diff --git a/pdfresources.dtx b/pdfresources.dtx
index df01f9c..b974e2c 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -2349,12 +2349,13 @@
   }
 %    \end{macrocode}
 
-
+%=====================
 % \subsection{Higher-level link management}
 % \subsubsection{Startlink}
-% packages like ocgx2 and tagpdf wants to add code to links/annotation created by hyperref.
-% So we need a generic command to start a pdflink which allows packages to add
-% their code to the \texttt{attr} argument through hooks.
+% packages like ocgx2 and tagpdf wants to add code to links/annotation created
+% by hyperref. So we need a generic command to start a pdflink which allows
+% packages to add their code to the \texttt{attr} argument through hooks.
+% % what is is for??
 %    \begin{macrocode}
 \cs_new:Nn \@@_get_key_value:nn { #1~#2~ } %name?????
 %    \end{macrocode}
@@ -2623,82 +2624,86 @@
 % unproblematic for now).
 %    \begin{macrocode}
 \bool_if:nT { !\g_@@_patches_bool || \sys_if_output_dvi_p:  }
- {
-  \file_input_stop:
- }
+  {
+    \file_input_stop:
+  }
 \msg_info:nn{pdf}{patches}
 \RequirePackage{etoolbox}
 % code to add to the resources existing stuff in the format "/name value":
 \cs_new:Npn \@@_split_dict_entry_aux:NNw #1 #2 /#3~#4\q_stop
- {
-  \tl_set:Nn #1 {#3}
-  \tl_set:Nn #2 {#4}
- }
+  {
+    \tl_set:Nn #1 {#3}
+    \tl_set:Nn #2 {#4}
+  }
 \tl_new:N \l_@@_name_tmp_tl
 \tl_new:N \l_@@_value_tmp_tl
 
 
 \cs_generate_variant:Nn \pdf_pageresources_gput:nnn {noo}
+
 \cs_new_protected:Npn \pdf_pageresources_split_gput:nn  #1 #2  %#1  resources
- {
-   \@@_split_dict_entry_aux:NNw \l_@@_name_tmp_tl \l_@@_value_tmp_tl #2 \q_stop
-   \pdf_pageresources_gput:noo {#1}{\l_@@_name_tmp_tl}{\l_@@_value_tmp_tl}
- }
+  {
+    \@@_split_dict_entry_aux:NNw \l_@@_name_tmp_tl \l_@@_value_tmp_tl #2 \q_stop
+    \pdf_pageresources_gput:noo {#1}{\l_@@_name_tmp_tl}{\l_@@_value_tmp_tl}
+  }
 
 %Trying to patch pgf ..
 \AtBeginDocument
- {
+  {
   % extgstate
-  \cs_new:Npn \@@_patch_pgfextgs:w  #1/#2<<#3>>#4\q_stop
-   {
-    \@@_backend_PageNResources_gput:nnn {ExtGState}{#2}{<<#3>>}
-   }
+    \cs_new:Npn \@@_patch_pgfextgs:w  #1/#2<<#3>>#4\q_stop
+      {
+        \@@_backend_PageNResources_gput:nnn {ExtGState}{#2}{<<#3>>}
+      }
 
-  \def\pgf at sys@addpdfresource at extgs@plain#1
-   {
-    \exp_after:wN %for transparent which passes a command
-    \@@_patch_pgfextgs:w #1\q_stop
-   }
+    \def\pgf at sys@addpdfresource at extgs@plain#1
+      {
+        \exp_after:wN %for transparent which passes a command
+          \@@_patch_pgfextgs:w #1\q_stop
+      }
 
   % patterns
-  \cs_new:Npn \@@_patch_pgfpatterns:w  #1/#2\space#3\q_stop
-   {
-    \exp_args:Nnnx \@@_backend_PageNResources_gput:nnn {Pattern}{#2}{#3}
-   }
-  \def\pgf at sys@addpdfresource at patterns@plain#1
-   {
-    \@@_patch_pgfpatterns:w #1\q_stop
-   }
+    \cs_new:Npn \@@_patch_pgfpatterns:w  #1/#2\space#3\q_stop
+      {
+        \exp_args:Nnnx \@@_backend_PageNResources_gput:nnn {Pattern}{#2}{#3}
+      }
+    \def\pgf at sys@addpdfresource at patterns@plain#1
+      {
+        \@@_patch_pgfpatterns:w #1\q_stop
+      }
 
   %colorspace is already set when tikz is loaded:
   \cs_new:Npn \@@_patch_pgfcolorspace:w  #1/#2[#3]#4\q_stop
-   {
-    \@@_backend_PageNResources_gput:nnn {ColorSpace}{#2}{[#3]}
-   }
+    {
+      \@@_backend_PageNResources_gput:nnn {ColorSpace}{#2}{[#3]}
+    }
   \tl_if_exist:NT \pgf at sys@pgf at resource@list at colorspaces
-  {
-   \exp_last_unbraced:NV
-    \@@_patch_pgfcolorspace:w  \pgf at sys@pgf at resource@list at colorspaces\q_stop
-   \pgfutil at everybye{}
+    {
+      \exp_last_unbraced:NV
+        \@@_patch_pgfcolorspace:w  \pgf at sys@pgf at resource@list at colorspaces\q_stop
+      \pgfutil at everybye{}
+    }
   }
- }
 % transparent, we assume that pdfresource is loaded first.
 
 \AtEndPreamble
- {
-  \def\TRP at addresource
-   {
-    \@@_backend_PageNResources_gput:nnn{ExtGState}{TRP1}{<</ca~1/CA~1>>}
-   }
-  \def\transparent at use#1
   {
-   \tl_if_exist:cF{TRP#1}
-    {
-     \@@_backend_PageNResources_gput:nnn{ExtGState}{TRP#1}{<</ca~#1/CA~#1>>}
-     \tl_const:cn{TRP#1}{/TRP#1~gs}
-    }
+    \def\TRP at addresource
+      {
+        \@@_backend_PageNResources_gput:nnn{ExtGState}{TRP1}{<</ca~1/CA~1>>}
+      }
+    \def\transparent at use#1
+      {
+        \tl_if_exist:cF{TRP#1}
+          {
+            \@@_backend_PageNResources_gput:nnn
+              {ExtGState}
+              {TRP#1}
+              {<</ca~#1/CA~#1>>}
+            \tl_const:cn{TRP#1}{/TRP#1~gs}
+          }
+       }
   }
- }
 
 %colorspace.sty
 % rather difficult as no real places to inject patches
@@ -2706,34 +2711,36 @@
 % it can not be avoided to recreate the objects (and so to get duplicates)
 % as colorspace uses temporary macros whose contents is lost.
 \AtEndPreamble
-{
- \tl_if_exist:NT \spc at op
- {
-  \@@_backend_object_new:nn  {__spc_extgstate_op_false}{dict}
-  \@@_backend_object_write:nn
-   {__spc_extgstate_op_false}
-   {/Type /ExtGState~/op~false~/OP~false}
-  \pdf_pageresources_gput:nnn
-   {ExtGState}
-   {SPCko}
-   {\@@_backend_object_ref:n {__spc_extgstate_op_false}}
-  \@@_backend_object_new:nn  {__spc_extgstate_op_true0}{dict}
-  \@@_backend_object_write:nn{__spc_extgstate_op_true0}
-   {/Type /ExtGState~/op~true~/OP~true~/OPM~0}%
-  \pdf_pageresources_gput:nnn
-   {ExtGState}
-   {SPCmz}
-   {\@@_backend_object_ref:n {__spc_extgstate_op_true0}}
-  \@@_backend_object_new:nn  {__spc_extgstate_op_true1}{dict}
-  \@@_backend_object_write:nn{__spc_extgstate_op_true1}
-   {/Type /ExtGState~/op~true~/OP~true~/OPM~1}%
-  \pdf_pageresources_gput:nnn
-   {ExtGState}
-   {SPCop}
-   {\@@_backend_object_ref:n {__spc_extgstate_op_true1}}
- \def\spc at Pageresources#1{}
- }
-}
+  {
+    \tl_if_exist:NT \spc at op
+      {
+        \@@_backend_object_new:nn  {__spc_extgstate_op_false}{dict}
+        \@@_backend_object_write:nn
+          {__spc_extgstate_op_false}
+          {/Type /ExtGState~/op~false~/OP~false}
+        \pdf_pageresources_gput:nnn
+          {ExtGState}
+          {SPCko}
+          {\@@_backend_object_ref:n {__spc_extgstate_op_false}}
+        \@@_backend_object_new:nn  {__spc_extgstate_op_true0}{dict}
+        \@@_backend_object_write:nn
+          {__spc_extgstate_op_true0}
+          {/Type /ExtGState~/op~true~/OP~true~/OPM~0}%
+        \pdf_pageresources_gput:nnn
+          {ExtGState}
+          {SPCmz}
+          {\@@_backend_object_ref:n {__spc_extgstate_op_true0}}
+        \@@_backend_object_new:nn  {__spc_extgstate_op_true1}{dict}
+        \@@_backend_object_write:nn
+          {__spc_extgstate_op_true1}
+          {/Type /ExtGState~/op~true~/OP~true~/OPM~1}%
+        \pdf_pageresources_gput:nnn
+          {ExtGState}
+          {SPCop}
+          {\@@_backend_object_ref:n {__spc_extgstate_op_true1}}
+        \def\spc at Pageresources#1{}
+      }
+  }
 
 %</package>
 %    \end{macrocode}





More information about the latex3-commits mailing list