[latex3-commits] [git/LaTeX3-latex3-latex3] master: Function to reference PDF objects (31a5e5c)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Sep 2 10:08:39 CEST 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/31a5e5cc03676f6448ac1955ecc1614cfbc95e01

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

commit 31a5e5cc03676f6448ac1955ecc1614cfbc95e01
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Sep 2 09:08:39 2018 +0100

    Function to reference PDF objects


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

31a5e5cc03676f6448ac1955ecc1614cfbc95e01
 l3kernel/l3drivers.dtx                  |   22 ++++++++++++++++++++++
 l3kernel/testfiles/m3expl001.luatex.tlg |    2 ++
 l3kernel/testfiles/m3expl001.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl001.tlg        |    2 ++
 l3kernel/testfiles/m3expl001.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl001.xetex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.luatex.tlg |    2 ++
 l3kernel/testfiles/m3expl003.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl003.tlg        |    2 ++
 l3kernel/testfiles/m3expl003.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.xetex.tlg  |    1 +
 11 files changed, 36 insertions(+)

diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 825646e..067f376 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -482,6 +482,14 @@
 %   subsequently be used by \cs{driver_pdf_dictionary_gput:nnn}.
 % \end{function}
 %
+% \begin{function}[EXP]{\driver_pdf_dictionary_ref:n}
+%   \begin{syntax}
+%     \cs{driver_pdf_dictionary_ref:n} \Arg{dictionary}
+%   \end{syntax}
+%   Inserts the appropriate information to reference the \meta{dictionary}
+%   in for example page resource allocation.
+% \end{function}
+%
 % \begin{function}{\driver_pdf_dictionary_gput:nnn}
 %   \begin{syntax}
 %     \cs{driver_pdf_dictionary_gput:nnn} \Arg{name} \Arg{key} \Arg{value}
@@ -1383,12 +1391,14 @@
 % \subsubsection{PDF Features}
 %
 % \begin{macro}{\driver_pdf_dictionary_declare:n}
+% \begin{macro}[EXP]{\driver_pdf_dictionary_ref:n}
 % \begin{macro}{\driver_pdf_dictionary_gput:nnn}
 % \begin{macro}{\driver_pdf_compresslevel:n}
 % \begin{macro}{\driver_pdf_objects_enable:, \driver_pdf_objects_disable:}
 %   These are all no-ops.
 %    \begin{macrocode}
 \cs_new_protected:Npn \driver_pdf_dictionary_declare:n #1 { }
+\cs_new:Npn \driver_pdf_dictionary_ref:n #1 { }
 \cs_new_protected:Npn \driver_pdf_dictionary_gput:nnn #1#2#3 { }
 \cs_new_protected:Npn \driver_pdf_compresslevel:n #1 { }
 \cs_new_protected:Npn \driver_pdf_objects_enable: { }
@@ -1398,6 +1408,7 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 %    \begin{macrocode}
 %</dvips>
@@ -1681,6 +1692,7 @@
 % \end{variable}
 %
 % \begin{macro}{\driver_pdf_dictionary_declare:n, \@@_pdf_object_declare:n}
+% \begin{macro}[EXP]{\driver_pdf_dictionary_ref:n, \@@_pdf_object_ref:n}
 %   Creating a dictionary requires an object: the latter can have no
 %   assumptions about structure, so the task is split into two.
 %    \begin{macrocode}
@@ -1707,8 +1719,13 @@
           { \tex_pdflastobj:D }
       }
   }
+\cs_new:Npn \driver_pdf_dictionary_ref:n #1
+  { \@@_pdf_object_ref:n {#1} }
+\cs_new:Npn \@@_pdf_object_ref:n #1
+  { \int_use:c { g_@@_pdf_object_ \tl_to_str:n {#1} _int } }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\driver_pdf_dictionary_gput:nnn}
 %   Storing data for a dictionary is a pure \TeX{} operation.
@@ -2057,6 +2074,7 @@
 % \end{variable}
 %
 % \begin{macro}{\driver_pdf_dictionary_declare:n}
+% \begin{macro}[EXP]{\driver_pdf_dictionary_ref:n}
 %   Everything is handled by the driver, but we track at the macro level
 %   so we can make sure there is always an object to accept data.
 %    \begin{macrocode}
@@ -2068,6 +2086,7 @@
         \seq_gpush:Nn \g_@@_pdf_dictionary_seq {#1}
       }
   }
+\cs_new:Npn \driver_pdf_dictionary_ref:n #1 { @ #1 }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -2853,12 +2872,14 @@
 % \subsubsection{PDF Features}
 %
 % \begin{macro}{\driver_pdf_dictionary_declare:n}
+% \begin{macro}[EXP]{\driver_pdf_dictionary_ref:n}
 % \begin{macro}{\driver_pdf_dictionary_gput:nnn}
 % \begin{macro}{\driver_pdf_compresslevel:n}
 % \begin{macro}{\driver_pdf_objects_enable:, \driver_pdf_objects_disable:}
 %   These are all no-ops.
 %    \begin{macrocode}
 \cs_new_protected:Npn \driver_pdf_dictionary_declare:n #1 { }
+\cs_new:Npn \driver_pdf_dictionary_ref:n #1 { }
 \cs_new_protected:Npn \driver_pdf_dictionary_gput:nnn #1#2#3 { }
 \cs_new_protected:Npn \driver_pdf_compresslevel:n #1 { }
 \cs_new_protected:Npn \driver_pdf_objects_enable: { }
@@ -2868,6 +2889,7 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \subsubsection{Drawing}
 %
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index d2d6020..024f36f 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -6147,6 +6147,8 @@ Defining \__driver_image_include_png:n on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
 Defining \__driver_pdf_object_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
+Defining \__driver_pdf_object_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \__driver_pdf_dictionary_finalise: on line ...
 Defining \__driver_pdf_dictionary_finalise:nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 78f2599..3860bb2 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -6179,6 +6179,7 @@ Defining \__driver_image_include_auxii:xnn on line ...
 Defining \__driver_image_include_auxiii:nnn on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 4826b83..4edc202 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -6385,6 +6385,8 @@ Defining \__driver_image_include_png:n on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
 Defining \__driver_pdf_object_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
+Defining \__driver_pdf_object_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \__driver_pdf_dictionary_finalise: on line ...
 Defining \__driver_pdf_dictionary_finalise:nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 984c18d..49d72dd 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -6377,6 +6377,7 @@ Defining \__driver_image_include_auxii:xnn on line ...
 Defining \__driver_image_include_auxiii:nnn on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 4a2c6a7..e4e48cc 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -6142,6 +6142,7 @@ Defining \__driver_image_include_auxii:xnn on line ...
 Defining \__driver_image_include_auxiii:nnn on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index d2d6020..024f36f 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -6147,6 +6147,8 @@ Defining \__driver_image_include_png:n on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
 Defining \__driver_pdf_object_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
+Defining \__driver_pdf_object_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \__driver_pdf_dictionary_finalise: on line ...
 Defining \__driver_pdf_dictionary_finalise:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 78f2599..3860bb2 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -6179,6 +6179,7 @@ Defining \__driver_image_include_auxii:xnn on line ...
 Defining \__driver_image_include_auxiii:nnn on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 4826b83..4edc202 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -6385,6 +6385,8 @@ Defining \__driver_image_include_png:n on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
 Defining \__driver_pdf_object_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
+Defining \__driver_pdf_object_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \__driver_pdf_dictionary_finalise: on line ...
 Defining \__driver_pdf_dictionary_finalise:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 984c18d..49d72dd 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -6377,6 +6377,7 @@ Defining \__driver_image_include_auxii:xnn on line ...
 Defining \__driver_image_include_auxiii:nnn on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 4a2c6a7..e4e48cc 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -6142,6 +6142,7 @@ Defining \__driver_image_include_auxii:xnn on line ...
 Defining \__driver_image_include_auxiii:nnn on line ...
 Defining \g__driver_pdf_dictionary_seq on line ...
 Defining \driver_pdf_dictionary_declare:n on line ...
+Defining \driver_pdf_dictionary_ref:n on line ...
 Defining \driver_pdf_dictionary_gput:nnn on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...





More information about the latex3-commits mailing list