[latex3-commits] [git/LaTeX3-latex3-pdfresources] splitting: moving bdc code to backend (f71baa6)

Ulrike Fischer fischer at troubleshooting-tex.de
Sat Jul 4 18:12:01 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : splitting
Link       : https://github.com/latex3/pdfresources/commit/f71baa64c17bb179faa3052de135e16e32446379

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

commit f71baa64c17bb179faa3052de135e16e32446379
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat Jul 4 18:12:01 2020 +0200

    moving bdc code to backend


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

f71baa64c17bb179faa3052de135e16e32446379
 l3backend-pdf-extra.dtx | 355 ++++++++++++++++++++++++++++++++++++++++++++++++
 pdfresources.dtx        | 354 -----------------------------------------------
 2 files changed, 355 insertions(+), 354 deletions(-)

diff --git a/l3backend-pdf-extra.dtx b/l3backend-pdf-extra.dtx
index 3de6962..3689558 100644
--- a/l3backend-pdf-extra.dtx
+++ b/l3backend-pdf-extra.dtx
@@ -568,6 +568,361 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \subsubsection{Page resources /Properties + BDC operators}
+% \begin{macro}
+%   {
+%     \@@_backend_bdc:nn,
+%     \@@_backend_bdc_obj:nn,
+%     \@@_backend_bdc_obj:n,
+%     \@@_backend_bmc:n,
+%     \@@_backend_emc:,
+%     \@@_backend_PageResources_gpush:n
+%   }
+% \cs{@@_backend_bdc:nn}, \cs{@@_backend_bdc_obj:nn}, \cs{@@_backend_bdc_obj:n},
+% \cs{@@_backend_bmc:n} and \cs{@@_backend_emc:}
+%  are the backend command that
+%  create the bdc/emc marker and store the properties.
+% \cs{@@_backend_PageResources_gpush:n} outputs the /Properties and/or the other
+% resources for the current page.
+%    \begin{macrocode}
+% pdftex and luatex (and perhaps dvips ...) need to know if there are in a
+% xform stream ...
+%<*drivers>
+\bool_new:N \l_@@_backend_xform_bool
+%</drivers>
+%<*dvips>
+% dvips is easy: create an object, and reference it in the bdc
+% ghostscript will then automatically replace it by a name
+% and add the name to the /Properties dict
+% special variant von accsupp
+% https://chat.stackexchange.com/transcript/message/50831812#50831812
+%
+\cs_set_protected:Npn \@@_backend_bdc:nn #1 #2 % #1 eg. Span, #2: dict_content
+  {
+    \__pdf_backend_pdfmark:x{/#1~<<#2>>~/BDC}
+  }
+\cs_set_protected:Npn \@@_backend_bdc_obj:nn #1 #2 % #1 eg. Span, #2: object name
+  {
+    \__pdf_backend_pdfmark:x{/#1~\@@_backend_object_ref:n{#2}~/BDC}
+  }
+\cs_set_protected:Npn \@@_backend_bdc_obj:n #1  % #1 eg. Span,
+  {
+    \__pdf_backend_pdfmark:x{/#1~\@@_backend_object_last:~/BDC}
+  }
+\cs_set_protected:Npn \@@_backend_emc:
+  {
+    \__pdf_backend_pdfmark:n{/EMC} %
+  }
+\cs_set_protected:Npn \@@_backend_bmc:n #1
+  {
+    \__pdf_backend_pdfmark:n{/#1~/BMC} %
+  }
+\cs_new_protected:Npn \@@_backend_PageResources_gpush:n #1 {}
+
+%</dvips>
+% xetex has to create the entries in the /Properties manually
+% (like the other backends)
+% use pdfbase special
+% https://chat.stackexchange.com/transcript/message/50832016#50832016
+% the property is added to xform resources automatically,
+% no need to worry about it.
+%<*dvipdfmx|xdvipdfmx>
+ \cs_set_protected:Npn \@@_backend_bdc_obj:nn #1 #2 % #1 eg. Span, #2: object name
+   {
+     \int_gincr:N \g_@@_backend_name_int
+     \__kernel_backend_literal:x
+       {
+         pdf:code~/#1/l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC
+       }
+     \__kernel_backend_literal:x
+       {
+         pdf:put~@resources~
+           <<
+             /Properties~
+               <<
+                 /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl
+                 \@@_backend_object_ref:n { #2 }
+               >>
+           >>
+       }
+   }
+ \cs_set_protected:Npn \@@_backend_bdc_obj:n #1  % #1 eg. Span
+   {
+     \int_gincr:N \g_@@_backend_name_int
+     \__kernel_backend_literal:x
+       {
+         pdf:code~/#1/l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC
+       }
+     \__kernel_backend_literal:x
+       {
+         pdf:put~@resources~
+           <<
+             /Properties~
+               <<
+                 /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl
+                 \@@_backend_object_last:
+               >>
+           >>
+       }
+   }
+\cs_set_protected:Npn \@@_backend_bmc:n #1
+   {
+     \__kernel_backend_literal:n {pdf:code~/#1~BMC}  %pdfbase
+   }
+
+%this require management
+\cs_set_protected:Npn \@@_backend_bdc_contobj:nn #1 #2
+  {
+    \pdf_object_now:nn { dict }{ #2 }
+    \@@_backend_bdc_obj:n { #1 }
+  }
+
+\cs_set_protected:Npn \@@_backend_bdc_contstream:nn #1 #2
+  {
+    \__kernel_backend_literal:n {pdf:code~ /#1~<<#2>>~BDC }
+  }
+
+\cs_set_protected:Npn \@@_backend_bdc:nn #1 #2
+  {
+    \bool_if:NTF  \g_@@_Core_active_bool
+      {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contobj:nn}
+      {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contstream:nn}
+      \@@_backend_bdc:nn {#1}{#1}
+  }
+\cs_set_protected:Npn \@@_backend_emc:
+  {
+    \__kernel_backend_literal:n {pdf:code~EMC}  %pdfbase
+  }
+  % properties are handled automatically, but the other resources should be added
+  % at shipout
+\cs_new_protected:Npn \@@_backend_PageResources_gpush:n #1
+  {
+    \clist_map_inline:Nn \c_@@_backend_PageResources_clist
+      {
+        \prop_if_empty:cF { \pdfdict_gname:n {Core/Page/Resources/##1} }
+          {
+            \__kernel_backend_literal:x
+              {
+                pdf:put~@resources~
+                  <</##1~\@@_backend_object_ref:n {Page/Resources/##1}>>
+              }
+          }
+      }
+  }
+%</dvipdfmx|xdvipdfmx>
+% luatex + pdftex
+%<*pdfmode>
+\sys_if_engine_luatex:T
+  {
+    \cs_set_protected:Npn \@@_backend_bdc_obj:nn #1 #2 % #1 eg. Span, #2: object name
+      {
+        \int_gincr:N \g_@@_backend_name_int
+        \exp_args:Nx\__kernel_backend_literal_page:n
+          { /#1 ~ /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC }
+        \bool_if:NTF \l_@@_backend_xform_bool
+          {
+            \exp_args:Nnx\pdfdict_gput:nnn
+              { Core/Xform/Resources/Properties }
+              { l3pdf\int_use:N\g_@@_backend_name_int }
+              { \@@_backend_object_ref:n { #2 } }
+          }
+          {
+            \exp_args:Nx \tex_latelua:D
+              {
+                l3kernel.pdf.Page_Resources_Properties_gput
+                  (
+                    tex.count["g_shipout_readonly_int"],
+                    "l3pdf\int_use:N\g_@@_backend_name_int",
+                    "\@@_backend_object_ref:n { #2 }"
+                  )
+              }
+          }
+    }
+    \cs_set_protected:Npn \@@_backend_bdc_obj:n #1% #1 eg. Span
+      {
+        \int_gincr:N \g_@@_backend_name_int
+        \exp_args:Nx\__kernel_backend_literal_page:n
+          { /#1 ~ /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC }
+        \bool_if:NTF \l_@@_backend_xform_bool
+          {
+            \exp_args:Nnx\pdfdict_gput:nnn %no handler needed
+              { Core/Xform/Resources/Properties }
+              { l3pdf\int_use:N\g_@@_backend_name_int }
+              { \@@_backend_object_last: }
+          }
+          {
+            \exp_args:Nx \tex_latelua:D
+              {
+                l3kernel.pdf.Page_Resources_Properties_gput
+                  (
+                    tex.count["g_shipout_readonly_int"],
+                    "l3pdf\int_use:N\g_@@_backend_name_int",
+                    "\@@_backend_object_last:"
+                  )
+              }
+          }
+    }
+   \cs_set_protected:Npn \@@_backend_bmc:n #1
+      {
+        \__kernel_backend_literal_page:n { /#1~BMC }
+      }
+   \cs_set_protected:Npn \@@_backend_bdc_contobj:nn #1 #2
+     {
+       \pdf_object_now:nn { dict } { #2 }
+       \@@_backend_bdc_obj:n { #1 }
+     }
+   \cs_set_protected:Npn \@@_backend_bdc_contstream:nn #1 #2
+     {
+       \__kernel_backend_literal_page:n { /#1~<<#2>>~BDC }
+     }
+  \cs_set_protected:Npn \@@_backend_bdc:nn #1 #2
+    {
+      \bool_if:NTF  \g_@@_Core_active_bool
+        {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contobj:nn}
+        {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contstream:nn}
+        \@@_backend_bdc:nn {#1}{#1}
+    }
+    \cs_set_protected:Npn \@@_backend_emc:
+      {
+        \__kernel_backend_literal_page:n { EMC }
+      }
+
+    \cs_new_protected:Npn \@@_backend_PageResources_gpush:n #1 {}
+  }
+
+% pdflatex is the most complicated as it has to go through the aux ...
+% the push command is extended to take other resources too
+\sys_if_engine_pdftex:T
+  {
+    \cs_set_protected:Npn \@@_backend_bdc_obj:nn #1 #2 % #1 eg. Span, #2: object name
+      {
+        \int_gincr:N \g_@@_backend_name_int
+        \exp_args:Nx\__kernel_backend_literal_page:n
+          { /#1 ~ /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC }
+        % code to set the property ....
+        \int_gincr:N\g_@@_backend_resourceid_int
+        \bool_if:NTF \l_@@_backend_xform_bool
+          {
+            \exp_args:Nnxx\pdfdict_gput:nnn %no handler needed
+              { Core/Xform/Resources/Properties }
+              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
+              { \@@_backend_object_ref:n { #2 } }
+          }
+          {
+            \zref at labelbylist
+              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
+              { l3pdf }
+            \tl_set:Nx \l_@@_tmpa_tl
+              {
+                \zref at extractdefault
+                  { l3pdf\int_use:N\g_@@_backend_resourceid_int }
+                  {pdf at abspage}
+                  {0}
+              }
+            \pdfdict_if_gexist:nF { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
+              {
+                \pdfdict_gnew:n  { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
+              }
+            \exp_args:Nnxx\pdfdict_gput:nnn
+              { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
+              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
+              { \@@_backend_object_ref:n{#2} }
+          }
+      }
+    \cs_set_protected:Npn \@@_backend_bdc_obj:n #1% #1 eg. Span
+      {
+        \int_gincr:N \g_@@_backend_name_int
+        \exp_args:Nx\__kernel_backend_literal_page:n
+          { /#1 ~ /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC }
+        % code to set the property ....
+        \int_gincr:N\g_@@_backend_resourceid_int
+        \bool_if:NTF \l_@@_backend_xform_bool
+          {
+            \exp_args:Nnxx\pdfdict_gput:nnn
+              { Core/Xform/Resources/Properties }
+              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
+              { \@@_backend_object_last: }
+          }
+          {
+            \zref at labelbylist
+              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
+              { l3pdf }
+            \tl_set:Nx \l_@@_tmpa_tl
+              {
+                \zref at extractdefault
+                  { l3pdf\int_use:N\g_@@_backend_resourceid_int }
+                  {pdf at abspage}
+                  {0}
+              }
+            \pdfdict_if_gexist:nF { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
+              {
+                \pdfdict_gnew:n { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
+              }
+            \exp_args:Nnxx\pdfdict_gput:nnn
+              { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
+              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
+              { \@@_backend_object_last: }
+            %\pdfdict_show:n { backend_Page\l_@@_tmpa_tl/Resources/Properties }
+          }
+      }
+  \cs_set_protected:Npn \@@_backend_bmc:n #1
+    {
+      \__kernel_backend_literal_page:n { /#1~BMC }
+    }
+  \cs_set_protected:Npn \@@_backend_bdc_contobj:nn #1 #2
+     {
+       \pdf_object_now:nn { dict } { #2 }
+       \@@_backend_bdc_obj:n { #1 }
+     }
+  \cs_set_protected:Npn \@@_backend_bdc_contstream:nn #1 #2
+     {
+       \__kernel_backend_literal_page:n { /#1~<<#2>>~BDC }
+     }
+  \cs_set_protected:Npn \@@_backend_bdc:nn #1 #2
+    {
+      \bool_if:NTF  \g_@@_Core_active_bool
+        {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contobj:nn}
+        {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contstream:nn}
+        \@@_backend_bdc:nn {#1}{#1}
+    }
+  \cs_set_protected:Npn \@@_backend_emc:
+    {
+      \__kernel_backend_literal_page:n { EMC }
+    }
+
+  \cs_new:Npn \@@_backend_PageResources_gpush_aux:n #1 %#1 ExtGState etc
+    {
+      \prop_if_empty:cF
+        { \pdfdict_gname:n {Core/Page/Resources/#1} }
+        {
+          \pdfdict_item:ne { #1 }{ \pdf_object_ref:n {Page/Resources/#1}}
+        }
+    }
+
+  \cs_new_protected:Npn \@@_backend_PageResources_gpush:n #1
+    {
+       \exp_args:NNx \tex_global:D \tex_pdfpageresources:D
+         {
+           \prop_if_exist:cT
+             { \pdfdict_gname:n  { Core/backend_Page#1/Resources/Properties } }
+             {
+               /Properties~
+                 <<
+                   \prop_map_function:cN
+                     { \pdfdict_gname:n  { Core/backend_Page#1/Resources/Properties } }
+                     \pdfdict_item:ne
+                 >>
+             }
+           %% add ExtGState etc
+           \clist_map_function:NN
+             \c_@@_backend_PageResources_clist
+             \@@_backend_PageResources_gpush_aux:n
+         }
+    }
+  }
+%</pdfmode>
+%    \end{macrocode}
+% \end{macro}
 % \subsection{\enquote{Catalog} \& subdirectories (pdfcatalog) }
 % The backend command is already in the driver:
 % \cs{@@_backend_catalog_gput:nn}
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 725713e..a92c111 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -366,361 +366,7 @@
 %   \end{verbatim}
 % \end{function}
 %
-% \subsubsection{BDC and Properties / backend}
-% \begin{macro}
-%   {
-%     \@@_backend_bdc:nn,
-%     \@@_backend_bdc_obj:nn,
-%     \@@_backend_bdc_obj:n,
-%     \@@_backend_bmc:n,
-%     \@@_backend_emc:,
-%     \@@_backend_PageResources_gpush:n
-%   }
-% \cs{@@_backend_bdc:nn}, \cs{@@_backend_bdc_obj:nn}, \cs{@@_backend_bdc_obj:n},
-% \cs{@@_backend_bmc:n} and \cs{@@_backend_emc:}
-%  are the backend command that
-%  create the bdc/emc marker and store the properties.
-% \cs{@@_backend_PageResources_gpush:n} outputs the /Properties and/or the other
-% resources for the current page.
-%    \begin{macrocode}
-% pdftex and luatex (and perhaps dvips ...) need to know if there are in a
-% xform stream ...
-%<*drivers>
-\bool_new:N \l_@@_backend_xform_bool
-%</drivers>
-%<*dvips>
-% dvips is easy: create an object, and reference it in the bdc
-% ghostscript will then automatically replace it by a name
-% and add the name to the /Properties dict
-% special variant von accsupp
-% https://chat.stackexchange.com/transcript/message/50831812#50831812
-%
-\cs_set_protected:Npn \@@_backend_bdc:nn #1 #2 % #1 eg. Span, #2: dict_content
-  {
-    \__pdf_backend_pdfmark:x{/#1~<<#2>>~/BDC}
-  }
-\cs_set_protected:Npn \@@_backend_bdc_obj:nn #1 #2 % #1 eg. Span, #2: object name
-  {
-    \__pdf_backend_pdfmark:x{/#1~\@@_backend_object_ref:n{#2}~/BDC}
-  }
-\cs_set_protected:Npn \@@_backend_bdc_obj:n #1  % #1 eg. Span,
-  {
-    \__pdf_backend_pdfmark:x{/#1~\@@_backend_object_last:~/BDC}
-  }
-\cs_set_protected:Npn \@@_backend_emc:
-  {
-    \__pdf_backend_pdfmark:n{/EMC} %
-  }
-\cs_set_protected:Npn \@@_backend_bmc:n #1
-  {
-    \__pdf_backend_pdfmark:n{/#1~/BMC} %
-  }
-\cs_new_protected:Npn \@@_backend_PageResources_gpush:n #1 {}
 
-%</dvips>
-% xetex has to create the entries in the /Properties manually
-% (like the other backends)
-% use pdfbase special
-% https://chat.stackexchange.com/transcript/message/50832016#50832016
-% the property is added to xform resources automatically,
-% no need to worry about it.
-%<*dvipdfmx|xdvipdfmx>
- \cs_set_protected:Npn \@@_backend_bdc_obj:nn #1 #2 % #1 eg. Span, #2: object name
-   {
-     \int_gincr:N \g_@@_backend_name_int
-     \__kernel_backend_literal:x
-       {
-         pdf:code~/#1/l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC
-       }
-     \__kernel_backend_literal:x
-       {
-         pdf:put~@resources~
-           <<
-             /Properties~
-               <<
-                 /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl
-                 \@@_backend_object_ref:n { #2 }
-               >>
-           >>
-       }
-   }
- \cs_set_protected:Npn \@@_backend_bdc_obj:n #1  % #1 eg. Span
-   {
-     \int_gincr:N \g_@@_backend_name_int
-     \__kernel_backend_literal:x
-       {
-         pdf:code~/#1/l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC
-       }
-     \__kernel_backend_literal:x
-       {
-         pdf:put~@resources~
-           <<
-             /Properties~
-               <<
-                 /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl
-                 \@@_backend_object_last:
-               >>
-           >>
-       }
-   }
-\cs_set_protected:Npn \@@_backend_bmc:n #1
-   {
-     \__kernel_backend_literal:n {pdf:code~/#1~BMC}  %pdfbase
-   }
-
-%this require management
-\cs_set_protected:Npn \@@_backend_bdc_contobj:nn #1 #2
-  {
-    \pdf_object_now:nn { dict }{ #2 }
-    \@@_backend_bdc_obj:n { #1 }
-  }
-
-\cs_set_protected:Npn \@@_backend_bdc_contstream:nn #1 #2
-  {
-    \__kernel_backend_literal:n {pdf:code~ /#1~<<#2>>~BDC }
-  }
-
-\cs_set_protected:Npn \@@_backend_bdc:nn #1 #2
-  {
-    \bool_if:NTF  \g_@@_Core_active_bool
-      {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contobj:nn}
-      {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contstream:nn}
-      \@@_backend_bdc:nn {#1}{#1}
-  }
-\cs_set_protected:Npn \@@_backend_emc:
-  {
-    \__kernel_backend_literal:n {pdf:code~EMC}  %pdfbase
-  }
-  % properties are handled automatically, but the other resources should be added
-  % at shipout
-\cs_new_protected:Npn \@@_backend_PageResources_gpush:n #1
-  {
-    \clist_map_inline:Nn \c_@@_backend_PageResources_clist
-      {
-        \prop_if_empty:cF { \pdfdict_gname:n {Core/Page/Resources/##1} }
-          {
-            \__kernel_backend_literal:x
-              {
-                pdf:put~@resources~
-                  <</##1~\@@_backend_object_ref:n {Page/Resources/##1}>>
-              }
-          }
-      }
-  }
-%</dvipdfmx|xdvipdfmx>
-% luatex
-%<*pdfmode>
-\sys_if_engine_luatex:T
-  {
-    \cs_set_protected:Npn \@@_backend_bdc_obj:nn #1 #2 % #1 eg. Span, #2: object name
-      {
-        \int_gincr:N \g_@@_backend_name_int
-        \exp_args:Nx\__kernel_backend_literal_page:n
-          { /#1 ~ /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC }
-        \bool_if:NTF \l_@@_backend_xform_bool
-          {
-            \exp_args:Nnx\pdfdict_gput:nnn
-              { Core/Xform/Resources/Properties }
-              { l3pdf\int_use:N\g_@@_backend_name_int }
-              { \@@_backend_object_ref:n { #2 } }
-          }
-          {
-            \exp_args:Nx \tex_latelua:D
-              {
-                l3kernel.pdf.Page_Resources_Properties_gput
-                  (
-                    tex.count["g_shipout_readonly_int"],
-                    "l3pdf\int_use:N\g_@@_backend_name_int",
-                    "\@@_backend_object_ref:n { #2 }"
-                  )
-              }
-          }
-    }
-    \cs_set_protected:Npn \@@_backend_bdc_obj:n #1% #1 eg. Span
-      {
-        \int_gincr:N \g_@@_backend_name_int
-        \exp_args:Nx\__kernel_backend_literal_page:n
-          { /#1 ~ /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC }
-        \bool_if:NTF \l_@@_backend_xform_bool
-          {
-            \exp_args:Nnx\pdfdict_gput:nnn %no handler needed
-              { Core/Xform/Resources/Properties }
-              { l3pdf\int_use:N\g_@@_backend_name_int }
-              { \@@_backend_object_last: }
-          }
-          {
-            \exp_args:Nx \tex_latelua:D
-              {
-                l3kernel.pdf.Page_Resources_Properties_gput
-                  (
-                    tex.count["g_shipout_readonly_int"],
-                    "l3pdf\int_use:N\g_@@_backend_name_int",
-                    "\@@_backend_object_last:"
-                  )
-              }
-          }
-    }
-   \cs_set_protected:Npn \@@_backend_bmc:n #1
-      {
-        \__kernel_backend_literal_page:n { /#1~BMC }
-      }
-   \cs_set_protected:Npn \@@_backend_bdc_contobj:nn #1 #2
-     {
-       \pdf_object_now:nn { dict } { #2 }
-       \@@_backend_bdc_obj:n { #1 }
-     }
-   \cs_set_protected:Npn \@@_backend_bdc_contstream:nn #1 #2
-     {
-       \__kernel_backend_literal_page:n { /#1~<<#2>>~BDC }
-     }
-  \cs_set_protected:Npn \@@_backend_bdc:nn #1 #2
-    {
-      \bool_if:NTF  \g_@@_Core_active_bool
-        {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contobj:nn}
-        {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contstream:nn}
-        \@@_backend_bdc:nn {#1}{#1}
-    }
-    \cs_set_protected:Npn \@@_backend_emc:
-      {
-        \__kernel_backend_literal_page:n { EMC }
-      }
-
-    \cs_new_protected:Npn \@@_backend_PageResources_gpush:n #1 {}
-  }
-
-% pdflatex is the most complicated as it has to go through the aux ...
-% the push command is extended to take other resources too
-\sys_if_engine_pdftex:T
-  {
-    \cs_set_protected:Npn \@@_backend_bdc_obj:nn #1 #2 % #1 eg. Span, #2: object name
-      {
-        \int_gincr:N \g_@@_backend_name_int
-        \exp_args:Nx\__kernel_backend_literal_page:n
-          { /#1 ~ /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC }
-        % code to set the property ....
-        \int_gincr:N\g_@@_backend_resourceid_int
-        \bool_if:NTF \l_@@_backend_xform_bool
-          {
-            \exp_args:Nnxx\pdfdict_gput:nnn %no handler needed
-              { Core/Xform/Resources/Properties }
-              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
-              { \@@_backend_object_ref:n { #2 } }
-          }
-          {
-            \zref at labelbylist
-              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
-              { l3pdf }
-            \tl_set:Nx \l_@@_tmpa_tl
-              {
-                \zref at extractdefault
-                  { l3pdf\int_use:N\g_@@_backend_resourceid_int }
-                  {pdf at abspage}
-                  {0}
-              }
-            \pdfdict_if_gexist:nF { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
-              {
-                \pdfdict_gnew:n  { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
-              }
-            \exp_args:Nnxx\pdfdict_gput:nnn
-              { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
-              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
-              { \@@_backend_object_ref:n{#2} }
-          }
-      }
-    \cs_set_protected:Npn \@@_backend_bdc_obj:n #1% #1 eg. Span
-      {
-        \int_gincr:N \g_@@_backend_name_int
-        \exp_args:Nx\__kernel_backend_literal_page:n
-          { /#1 ~ /l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC }
-        % code to set the property ....
-        \int_gincr:N\g_@@_backend_resourceid_int
-        \bool_if:NTF \l_@@_backend_xform_bool
-          {
-            \exp_args:Nnxx\pdfdict_gput:nnn
-              { Core/Xform/Resources/Properties }
-              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
-              { \@@_backend_object_last: }
-          }
-          {
-            \zref at labelbylist
-              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
-              { l3pdf }
-            \tl_set:Nx \l_@@_tmpa_tl
-              {
-                \zref at extractdefault
-                  { l3pdf\int_use:N\g_@@_backend_resourceid_int }
-                  {pdf at abspage}
-                  {0}
-              }
-            \pdfdict_if_gexist:nF { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
-              {
-                \pdfdict_gnew:n { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
-              }
-            \exp_args:Nnxx\pdfdict_gput:nnn
-              { Core/backend_Page\l_@@_tmpa_tl/Resources/Properties }
-              { l3pdf\int_use:N\g_@@_backend_resourceid_int }
-              { \@@_backend_object_last: }
-            %\pdfdict_show:n { backend_Page\l_@@_tmpa_tl/Resources/Properties }
-          }
-      }
-  \cs_set_protected:Npn \@@_backend_bmc:n #1
-    {
-      \__kernel_backend_literal_page:n { /#1~BMC }
-    }
-  \cs_set_protected:Npn \@@_backend_bdc_contobj:nn #1 #2
-     {
-       \pdf_object_now:nn { dict } { #2 }
-       \@@_backend_bdc_obj:n { #1 }
-     }
-  \cs_set_protected:Npn \@@_backend_bdc_contstream:nn #1 #2
-     {
-       \__kernel_backend_literal_page:n { /#1~<<#2>>~BDC }
-     }
-  \cs_set_protected:Npn \@@_backend_bdc:nn #1 #2
-    {
-      \bool_if:NTF  \g_@@_Core_active_bool
-        {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contobj:nn}
-        {\cs_gset_eq:NN \@@_backend_bdc:nn \@@_backend_bdc_contstream:nn}
-        \@@_backend_bdc:nn {#1}{#1}
-    }
-  \cs_set_protected:Npn \@@_backend_emc:
-    {
-      \__kernel_backend_literal_page:n { EMC }
-    }
-
-  \cs_new:Npn \@@_backend_PageResources_gpush_aux:n #1 %#1 ExtGState etc
-    {
-      \prop_if_empty:cF
-        { \pdfdict_gname:n {Core/Page/Resources/#1} }
-        {
-          \pdfdict_item:ne { #1 }{ \pdf_object_ref:n {Page/Resources/#1}}
-        }
-    }
-
-  \cs_new_protected:Npn \@@_backend_PageResources_gpush:n #1
-    {
-       \exp_args:NNx \tex_global:D \tex_pdfpageresources:D
-         {
-           \prop_if_exist:cT
-             { \pdfdict_gname:n  { Core/backend_Page#1/Resources/Properties } }
-             {
-               /Properties~
-                 <<
-                   \prop_map_function:cN
-                     { \pdfdict_gname:n  { Core/backend_Page#1/Resources/Properties } }
-                     \pdfdict_item:ne
-                 >>
-             }
-           %% add ExtGState etc
-           \clist_map_function:NN
-             \c_@@_backend_PageResources_clist
-             \@@_backend_PageResources_gpush_aux:n
-         }
-    }
-  }
-%</pdfmode>
-%    \end{macrocode}
-% \end{macro}
 %
 % \subsubsection{BDC and Properties  / management}
 % \begin{macro}{\pdf_bdc:nn}





More information about the latex3-commits mailing list.