[latex3-commits] [git/LaTeX3-latex3-pdfresources] renamedict77: renamed Page code (a915854)

Ulrike Fischer fischer at troubleshooting-tex.de
Sun Apr 12 20:59:59 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : renamedict77
Link       : https://github.com/latex3/pdfresources/commit/a9158548ae0ec29aebb501f32b1c6cbdf9786f5e

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

commit a9158548ae0ec29aebb501f32b1c6cbdf9786f5e
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Apr 12 20:59:59 2020 +0200

    renamed Page code


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

a9158548ae0ec29aebb501f32b1c6cbdf9786f5e
 pdfresources.dtx | 42 +++++++++++++++++++++++++++---------------
 1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/pdfresources.dtx b/pdfresources.dtx
index 81ced74..02e53bb 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -620,7 +620,7 @@
   }
 
 % local / global
-\cs_new_protected:Npn \@@_dict_remove:nn #1 #2 %path,key
+\cs_new_protected:Npn \@@_dict_handler_remove:nn #1 #2 %path,key
   {
     \@@_dict_if_exist:nTF { #1 }
           {
@@ -642,6 +642,18 @@
           }
   }
 
+\cs_new_protected:Npn \@@_dict_remove:nn #1 #2 %path,key
+  {
+    \@@_dict_if_exist:nTF { #1 }
+          {
+            \use:c { prop_\@@_dict_get_g:n{#1}remove:cn }
+              { \@@_dict_Xname:n { #1 } }{ #2 }
+          }
+          {
+            \msg_error:nnn { pdfdict } { unknown-dict } { /#1 }
+          }
+  }
+
 
 \cs_new_protected:Npn \@@_dict_show:Nn #1#2
   {
@@ -823,7 +835,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \pdfdict_remove:nn #1 #2
   {
-    \@@_dict_remove:nn { #1 }{ #2 }
+    \@@_dict_handler_remove:nn { #1 }{ #2 }
   }
 %    \end{macrocode}
 %
@@ -1035,7 +1047,7 @@
 %  backend commands
 %  a prop for global/default settings which are used for more than
 %  one page
-\@@_dict_gnew:n {backend_Page}
+%\@@_dict_gnew:n {backend_Page}
 
 %pdflatex
 \bool_if:nT {\sys_if_engine_pdftex_p: && \sys_if_output_pdf_p: }
@@ -1050,14 +1062,14 @@
   % sets a lua table with lualatex
   \cs_new_protected:Npn \@@_backend_Page_gput:nn #1 #2 %key,value
     {
-      \@@_dict_handler_put:nnn {backend_Page}{ #1 }{ #2 }
+      \@@_dict_put:nnn {Page}{ #1 }{ #2 }
     }
   % the command to remove a default value.
   % Uses a prop with pdflatex + dvi,
   % changes a lua table with lualatex
   \cs_new_protected:Npn \@@_backend_Page_gremove:n #1
     {
-      \@@_dict_remove:nn  {backend_Page}{ #1 }
+      \@@_dict_remove:nn  {Page}{ #1 }
     }
  % the command used in the document.
  % direct call of the primitive special with dvips/dvipdfmx
@@ -1075,7 +1087,7 @@
             {pdf at abspage}
             {0}
         }
-      \@@_dict_gnew:n    {backend_Page\l_@@_tmpa_tl}
+      \@@_dict_gnew:n          {backend_Page\l_@@_tmpa_tl}
       \@@_dict_handler_put:nnn {backend_Page\l_@@_tmpa_tl}{ #1 }{ #2 }
     }
   %the code to push the values, used in shipout
@@ -1084,7 +1096,7 @@
   %issues the values stored in the global prop with dvi
   \cs_new_protected:Npn \@@_backend_ThisPage_gpush:n #1
     {
-      \@@_dict_gmerge:nnN {backend_Page}{backend_Page#1}\g_@@_tmpa_prop
+      \@@_dict_gmerge:nnN {Page}{backend_Page#1}\g_@@_tmpa_prop
       \exp_args:Nx \@@_backend_Page_primitive:n
         {
           \prop_map_function:NN \g_@@_tmpa_prop \@@_dict_item:nn
@@ -1173,14 +1185,14 @@
   % sets a lua table with lualatex
     \cs_new_protected:Npn \@@_backend_Page_gput:nn #1 #2
       {
-        \@@_dict_handler_put:nnn {backend_Page}{ #1 }{ #2 }
+        \@@_dict_put:nnn {Page}{ #1 }{ #2 }
       }
   % the command to remove a default value.
   % Uses a prop with pdflatex + dvi,
   % changes a lua table with lualatex
     \cs_new_protected:Npn \@@_backend_Page_gremove:n #1
       {
-        \@@_dict_remove:nn  {backend_Page}{ #1 }
+        \@@_dict_remove:nn  {Page}{ #1 }
       }
   % the command used in the document.
   % direct call of the primitive special with dvips/dvipdfmx
@@ -1199,7 +1211,7 @@
     \cs_new_protected:Npn \@@_backend_ThisPage_gpush:n #1
       {
         \exp_args:Nx \@@_backend_Page_primitive:n
-          { \@@_dict_map_dict_item:n {backend_Page} }
+          { \@@_dict_map_dict_item:n {Page} }
       }
   }
 %dvips
@@ -1214,14 +1226,14 @@
   % sets a lua table with lualatex
     \cs_new_protected:Npn \@@_backend_Page_gput:nn #1 #2
       {
-        \@@_dict_handler_put:nnn {backend_Page}{ #1 }{ #2 }
+        \@@_dict_put:nnn {Page}{ #1 }{ #2 }
       }
   % the command to remove a default value.
   % Uses a prop with pdflatex + dvi,
   % changes a lua table with lualatex
     \cs_new_protected:Npn \@@_backend_Page_gremove:n #1
       {
-        \@@_dict_remove:nn  {backend_Page}{ #1 }
+        \@@_dict_remove:nn  {Page}{ #1 }
       }
   % the command used in the document.
   % direct call of the primitive special with dvips/dvipdfmx
@@ -1240,7 +1252,7 @@
     \cs_new_protected:Npn \@@_backend_ThisPage_gpush:n #1
       {
         \exp_args:Nx \@@_backend_Page_primitive:n
-          { \@@_dict_map_dict_item:n {backend_Page} }
+          { \@@_dict_map_dict_item:n {Page} }
       }
   }
 %    \end{macrocode}
@@ -1299,13 +1311,13 @@
 %handler for pdfdict
 \cs_new_protected:cpn { @@_dict_handler/Page/?_gput:nn } #1 #2
   {
-    \prop_gput:cnn  { \@@_dict_gname:n { Page } }{ #1 } { #2 }
+    %\prop_gput:cnn  { \@@_dict_gname:n { Page } }{ #1 } { #2 }
     \@@_backend_Page_gput:nn { #1 }{ #2 }
   }
 % remove:
 \cs_new_protected:cpn { @@_dict_handler/Page/?_gremove:n } #1
   {
-    \prop_gremove:cn  { \@@_dict_gname:n { Page } }{ #1 }
+    %\prop_gremove:cn  { \@@_dict_gname:n { Page } }{ #1 }
     \@@_backend_Page_gremove:n { #1 }
   }
 





More information about the latex3-commits mailing list.