[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: removed functions that are in l3drivers now, unified names (b797279)

Ulrike Fischer fischer at troubleshooting-tex.de
Sun Apr 21 22:06:42 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : testlinkstuff
Link       : https://github.com/latex3/pdfresources/commit/b7972792961748ffa46c49c48efda58dc7e8e1bf

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

commit b7972792961748ffa46c49c48efda58dc7e8e1bf
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Apr 21 22:06:42 2019 +0200

    removed functions that are in l3drivers now, unified names


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

b7972792961748ffa46c49c48efda58dc7e8e1bf
 hluatex-experimental.def |   64 ++++++++++-----------
 pdfresources.dtx         |  144 +++++++++++++---------------------------------
 test-pdfresources.tex    |   24 +++++---
 3 files changed, 89 insertions(+), 143 deletions(-)

diff --git a/hluatex-experimental.def b/hluatex-experimental.def
index 3f23dea..fa01a60 100644
--- a/hluatex-experimental.def
+++ b/hluatex-experimental.def
@@ -52,22 +52,22 @@
   {
     \hook_put:nnnn
      { pdf }
-     { startlink_url_attr }
+     { link_begin_url_attr }
      { /F }{ 4 } %
 
     \hook_put:nnnn
      { pdf }
-     { startlink_link_attr }
+     { link_begin_link_attr }
      { /F } { 4 }
 
      \hook_put:nnnn
      { pdf }
-     { startlink_file_attr }
+     { link_begin_file_attr }
      { /F } { 4 }
 
      \hook_put:nnnn
      { pdf }
-     { startlink_menu_attr }
+     { link_begin_menu_attr }
      { /F } { 4 }
    }
 }
@@ -80,23 +80,23 @@
    {
     \tl_if_empty:NTF \@pdfborder
      {
-      \hook_remove:nnn { pdf } { startlink_##1_attr } { /Border }
+      \hook_remove:nnn { pdf } { link_begin_##1_attr } { /Border }
      }
      {
       \hook_put:nnnn
        { pdf }
-       { startlink_##1_attr }
+       { link_begin_##1_attr }
        { /Border }
        { [\@pdfborder] }
      }
     \tl_if_empty:NTF \@pdfborderstyle
      {
-      \hook_remove:nnn  { pdf }{ startlink_##1_attr } { /BS }
+      \hook_remove:nnn  { pdf }{ link_begin_##1_attr } { /BS }
      }
      {
       \hook_put:nnnn
       { pdf }
-      { startlink_##1_attr }
+      { link_begin_##1_attr }
       { /BS }
       { <<\@pdfborderstyle>> }
      }
@@ -109,12 +109,12 @@
    {
     \tl_if_empty:NTF \@pdfhighlight
      {
-      \hook_remove:nnn { pdf } { startlink_##1_attr }{ /H }
+      \hook_remove:nnn { pdf } { link_begin_##1_attr }{ /H }
      }
      {
       \hook_put:nnnn
       { pdf }
-      { startlink_##1_attr }
+      { link_begin_##1_attr }
       { /H }
       { \@pdfhighlight }
      }
@@ -127,12 +127,12 @@
    {
     \hook_put:nnnn
      { pdf }
-     { startlink_url_attr }
+     { link_begin_url_attr }
      { /C }
      { [\@urlbordercolor] }
    }
    {
-    \hook_remove:nnn { pdf } { startlink_url_attr } { /C }
+    \hook_remove:nnn { pdf } { link_begin_url_attr } { /C }
    }
   }
 
@@ -142,12 +142,12 @@
     {
      \hook_put:nnnn
       { pdf }
-      { startlink_file_attr }
+      { link_begin_file_attr }
       { /C }
       { [\@filebordercolor] }
     }
     {
-     \hook_remove:nnn { pdf } { startlink_file_attr }{ /C }
+     \hook_remove:nnn { pdf } { link_begin_file_attr }{ /C }
     }
   }
 
@@ -157,12 +157,12 @@
     {
      \hook_put:nnnn
       { pdf }
-      { startlink_menu_attr }
+      { link_begin_menu_attr }
       { /C }
       { [\@menubordercolor] }
     }
     {
-     \hook_remove:nnn { pdf } { startlink_menu_attr }{ /C }
+     \hook_remove:nnn { pdf } { link_begin_menu_attr }{ /C }
     }
   }
 
@@ -320,27 +320,27 @@
           The version should be set as early as possible:%
           \MessageBreak
           \space\space
-          \expandafter\string\Hy at pdfminorversion=\Hy at pdfversion
-          \string\relax
+          \string\pdf_version_gset:n{\driver_pdf_version_major:.\driver_pdf_version_minor:}
           \ifnum\Hy at pdfversion<5 %
-            \ltx at ifundefined{pdfobjcompresslevel}{%
-            }{%
               \MessageBreak
               \space\space
-              \string\pdfobjcompresslevel=0\string\relax
-            }%
+              \string\driver_pdf_objects_disable:
           \fi
           \Hy at temp@A
         }%
       \fi
     \fi
     \PackageInfo{hyperref}{%
-      \expandafter\string\Hy at pdfminorversion
-      :=\number\Hy at pdfversion\space
+      pdf~version~set~to~\driver_pdf_version_major:.\driver_pdf_version_minor:\space
     }%
  }
-  \edef\Hy at pdfversion{\driver_pdf_version_minor:}% XXXXXXXX = 10 for 2.0
-\ExplSyntaxOff
+  \edef\Hy at pdfversion
+  { % this will need revision when pdf version stuff is better sorted
+   \int_compare:nNnTF { \driver_pdf_version_minor: } = { 2 }
+    { 10 }
+    {\driver_pdf_version_minor:}
+  }
+ \ExplSyntaxOff
 \Hy at DisableOption{pdfversion}%
 
 \ExplSyntaxOn
@@ -515,14 +515,14 @@
 
 \ExplSyntaxOn
 \def\Hy at StartlinkName#1#2{%
-  \pdf_startlink_goto_name:nn { link } { #2 } %%% can this be done without splitting?
+  \pdf_link_begin_goto:nnw { link } { #2 } %%% can this be done without splitting?
 }
 
 
 \def\close at EXPpdflink#1{%
   \Hy at endcolorlink
   \Hy at VerboseLinkStop
-  \pdf_endlink:n { #1 }
+  \pdf_link_end:n { #1 }
 }
 
 \def\close at pdflink{%
@@ -553,13 +553,13 @@
    {
     \hook_put:nnnn
      { pdf }
-     { startlink_link_attr }
+     { link_begin_link_attr }
      { /C }{ [\tl_use:c { @#1bordercolor }] } %do I need to expand?? seems not
    }
    {
     \hook_remove:nnn
      { pdf }
-     { startlink_link_attr }
+     { link_begin_link_attr }
      { /C }
    }
   \find at pdflink{#1}{#2}% #1=color type
@@ -576,13 +576,13 @@
    {
     \hook_put:nnnn
      { pdf }
-     { startlink_link_attr }
+     { link_begin_link_attr }
      { /C }{ [\tl_use:c { @#1bordercolor }] } %do I need to expand?? seems not
    }
    {
     \hook_remove:nnn
      { pdf }
-     { startlink_link_attr }
+     { link_begin_link_attr }
      { /C }
    }
   \find at pdflink{#1}{#2}#3\Hy at xspace@end
diff --git a/pdfresources.dtx b/pdfresources.dtx
index c5dea89..c401728 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -90,39 +90,10 @@
 %
 %    \begin{macrocode}
 %<*pdfmode>
+
 %    \end{macrocode}
 %
-% \begin{macro}{\driver_pdf_startlink_goto:nn, \driver_pdf_startlink_user:nn}
-% \begin{macro}{\@@_pdf_startlink:nnn}
-%    \begin{macrocode}
-% %% will probably go shortly
-\cs_new_protected:Npn \driver_pdf_startlink_goto:nn #1#2
-  { \@@_pdf_startlink:nnn {#1} { goto~name } {#2} }
-\cs_new_protected:Npn \driver_pdf_startlink_user:nn #1#2
-  { \@@_pdf_startlink:nnn {#1} { user } {#2} }
-\cs_new_protected:Npx \@@_pdf_startlink:nnn #1#2#3
-  {
-    \cs_if_exist:NTF \tex_pdfextension:D
-      { \tex_pdfextension:D startlink ~ }
-      { \tex_pdfstartlink:D }
-      attr {#1}
-      \exp_not:N \tl_if_blank:nF {#2}
-        { ~ #2 {#3} }
-  }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
 %
-% \begin{macro}{\driver_pdf_endlink:}
-%    \begin{macrocode}
-\cs_new_protected:Npx \driver_pdf_endlink:
-  {
-    \cs_if_exist:NTF \tex_pdfextension:D
-      { \tex_pdfextension:D endlink }
-      { \tex_pdfendlink:D }
-  }
-%    \end{macrocode}
-% \end{macro}
 %
 %    \begin{macrocode}
 %</pdfmode>
@@ -134,41 +105,6 @@
 %<*dvipdfmx|dvixpdfmx>
 %    \end{macrocode}
 %
-% \begin{macro}{\@@_pdf:n}
-%    \begin{macrocode}
-\cs_new_protected:Npx \@@_pdf:n #1
-  { \@@_literal:n { pdf: #1 } }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\driver_pdf_startlink_goto:nn, \driver_pdf_startlink_user:nn}
-% \begin{macro}{\@@_pdf_startlink:nnn}
-%    \begin{macrocode}
-\cs_new_protected:Npn \driver_pdf_startlink_goto:nn #1#2
-  { \@@_pdf_startlink:nnn {#1} { /GoTo } {#2} }
-\cs_new_protected:Npn \driver_pdf_startlink_user:nn #1#2
-  { \@@_pdf_startlink:nnn {#1} { } {#2} }
-\cs_new_protected:Npn \@@_pdf_startlink:nnn #1#2#3
-  {
-    \@@_pdf:n
-      {
-         bann
-         <<
-           /Type /Annot
-           #1 ~ #2 ~ #3
-         >>
-      }
-  }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\driver_pdf_endlink:}
-%    \begin{macrocode}
-\cs_new_protected:Npx \driver_pdf_endlink:
-  { \@@_pdf:n { eann } }
-%    \end{macrocode}
-% \end{macro}
 %
 %    \begin{macrocode}
 %</dvipdfmx|dvixpdfmx>
@@ -386,11 +322,11 @@
 %
 %    \begin{macrocode}
 %<*package>
-\prop_new:N\l__pdf_hook_startlink_url_attr_prop  %\hyper at linkurl
-\prop_new:N\l__pdf_hook_startlink_file_attr_prop %\hyper at linkfile
-\prop_new:N\l__pdf_hook_startlink_run_attr_prop  %\@hyper at launch run
-\prop_new:N\l__pdf_hook_startlink_link_attr_prop %\hyper at link, \find at pdflink
-\prop_new:N\l__pdf_hook_startlink_menu_attr_prop %\Acrobatmenu
+\prop_new:N\l__pdf_hook_link_begin_url_attr_prop  %\hyper at linkurl
+\prop_new:N\l__pdf_hook_link_begin_file_attr_prop %\hyper at linkfile
+\prop_new:N\l__pdf_hook_link_begin_run_attr_prop  %\@hyper at launch run
+\prop_new:N\l__pdf_hook_link_begin_link_attr_prop %\hyper at link, \find at pdflink
+\prop_new:N\l__pdf_hook_link_begin_menu_attr_prop %\Acrobatmenu
 %</package>
 %    \end{macrocode}
 %
@@ -402,44 +338,44 @@
 %<*package>
 \cs_new_protected:Nn \pdf_link_user:nnn %#1 type (url, file etc, #2 action spec, #3 link text
  {
-   \seq_if_exist:cT { l__pdf_hook_startlink_#1_seq }
+   \seq_if_exist:cT { l__pdf_hook_link_begin_#1_seq }
    {
-    \seq_use:cn { l__pdf_hook_startlink_#1_seq }{}
+    \seq_use:cn { l__pdf_hook_link_begin_#1_seq }{}
    }
    \mode_leave_vertical:
-   \driver_pdf_link_user:nnn
+   %\driver_pdf_link_user:nnn
+   \driver_pdf_link_begin_user:nnw
     {
-     \prop_if_exist:cT { l__pdf_hook_startlink_#1_attr_prop }
+     \prop_if_exist:cT { l__pdf_hook_link_begin_#1_attr_prop }
      {
       \prop_map_function:cN
-       { l__pdf_hook_startlink_#1_attr_prop }
+       { l__pdf_hook_link_begin_#1_attr_prop }
        \__pdf_get_key_value:nn
       }
     }
     {
       #2
     }
-    {
-      #3
-    }
-   \seq_use:cn { l__pdf_hook_endlink_#1_seq }{}
+    #3
+   \driver_pdf_link_end:
+   \seq_use:cn { l__pdf_hook_link_end_#1_seq }{}
  }
 %</package>
 %    \end{macrocode}
 %    \begin{macrocode}
 %<*package>
-\cs_new_protected:Nn \pdf_startlink_user:nn %#1 type, #2 action spec
+\cs_new_protected:Npn \pdf_link_begin_user:nnw #1 #2 %#1 type, #2 action spec
 {
- \seq_if_exist:cT { l__pdf_hook_startlink_#1_seq }
+ \seq_if_exist:cT { l__pdf_hook_link_begin_#1_seq }
    {
-    \seq_use:cn { l__pdf_hook_startlink_#1_seq }{}
+    \seq_use:cn { l__pdf_hook_link_begin_#1_seq }{}
    }
- \driver_pdf_startlink_user:nn
+ \driver_pdf_link_begin_user:nnw
   {
-   \prop_if_exist:cT { l__pdf_hook_startlink_#1_attr_prop }
+   \prop_if_exist:cT { l__pdf_hook_link_begin_#1_attr_prop }
     {
      \prop_map_function:cN
-      { l__pdf_hook_startlink_#1_attr_prop }
+      { l__pdf_hook_link_begin_#1_attr_prop }
       \__pdf_get_key_value:nn
      }
   }
@@ -447,18 +383,18 @@
 }
 
 % At second one with the \texttt{goto name} argument:
-\cs_new_protected:Nn \pdf_startlink_goto_name:nn %#1 type, #2 destination
+\cs_new_protected:Npn \pdf_link_begin_goto:nnw #1 #2 %#1 type, #2 destination
 {
- \seq_if_exist:cT { l__pdf_hook_startlink_#1_seq }
+ \seq_if_exist:cT { l__pdf_hook_link_begin_#1_seq }
    {
-    \seq_use:cn { l__pdf_hook_startlink_#1_seq }{}
+    \seq_use:cn { l__pdf_hook_link_begin_#1_seq }{}
    }
- \driver_pdf_startlink_goto:nn
+ \driver_pdf_link_begin_goto:nnw
   {
-   \prop_if_exist:cT { l__pdf_hook_startlink_#1_attr_prop }
+   \prop_if_exist:cT { l__pdf_hook_link_begin_#1_attr_prop }
      {
       \prop_map_function:cN
-      { l__pdf_hook_startlink_#1_attr_prop }
+      { l__pdf_hook_link_begin_#1_attr_prop }
       \__pdf_get_key_value:nn
      }
   }
@@ -473,18 +409,18 @@
 % add and remove hooks by index. The hook depends on the type.
 %    \begin{macrocode}
 %<*package>
-\seq_new:N \l__pdf_hook_endlink_url_seq
-\seq_new:N \l__pdf_hook_endlink_run_seq
-\seq_new:N \l__pdf_hook_endlink_file_seq
-\seq_new:N \l__pdf_hook_endlink_link_seq
-\seq_new:N \l__pdf_hook_endlink_menu_seq
+\seq_new:N \l__pdf_hook_link_end_url_seq
+\seq_new:N \l__pdf_hook_link_end_run_seq
+\seq_new:N \l__pdf_hook_link_end_file_seq
+\seq_new:N \l__pdf_hook_link_end_link_seq
+\seq_new:N \l__pdf_hook_link_end_menu_seq
 
-\cs_new_protected:Nn \pdf_endlink:n %#1 type, e.g. url
+\cs_new_protected:Nn \pdf_link_end:n %#1 type, e.g. url
  {
-  \driver_pdf_endlink:
-  \seq_if_exist:cT {l__pdf_hook_endlink_#1_seq}
+  \driver_pdf_link_end:
+  \seq_if_exist:cT {l__pdf_hook_link_end_#1_seq}
    {
-    \seq_use:cn { l__pdf_hook_endlink_#1_seq }{}
+    \seq_use:cn { l__pdf_hook_link_end_#1_seq }{}
    }
  }
 
@@ -495,10 +431,10 @@
 % setup hooks for this too:
 %    \begin{macrocode}
 %<*package>
-\seq_new:N \l__pdf_hook_startlink_url_seq
-\seq_new:N \l__pdf_hook_startlink_run_seq
-\seq_new:N \l__pdf_hook_startlink_file_seq
-\seq_new:N \l__pdf_hook_startlink_link_seq
+\seq_new:N \l__pdf_hook_link_begin_url_seq
+\seq_new:N \l__pdf_hook_link_begin_run_seq
+\seq_new:N \l__pdf_hook_link_begin_file_seq
+\seq_new:N \l__pdf_hook_link_begin_link_seq
 %</package>
 %    \end{macrocode}
 %
diff --git a/test-pdfresources.tex b/test-pdfresources.tex
index 70fab8f..d4e2a9a 100644
--- a/test-pdfresources.tex
+++ b/test-pdfresources.tex
@@ -27,20 +27,29 @@
 \textwidth=5cm
 \begin{document}
 \makeatletter%\show\Hy at pstringdef
+
+abc%\end{document}
 \ExplSyntaxOn
+\driver_pdf_link_begin_user:nnw{}{/A<</Type/Action/S/URI/URI(www.blub.de)>>}
+\driver_pdf_link_end:
+
+\driver_pdf_link_begin_goto:nnw{}{Dest} xxx\driver_pdf_link_end:
+\PackageInfo{test}{\string\pdf_version_gset:n{<\driver_pdf_version_major:.\driver_pdf_version_minor:}}
 
-\ifnum \driver_pdf_version_minor: = 5 XXXXXXXXX \else YYYYYYY\fi
+%\ExplSyntaxOff
+%\end{document}
+%\ifnum \driver_pdf_version_minor: = 5 XXXXXXXXX \else YYYYYYY\fi
 
 
 \hook_put:nnnn
      { pdf }
-     { startlink_url_attr }
+     { link_begin_url_attr }
      { /C }
      { [1~0~0] }
 
 \hook_put:nnnn
        { pdf }
-       { startlink_url_attr }
+       { link_begin_url_attr }
        { /Border }
        { [1~1~1] }
 \driver_pdf_link_margin:n {1pt}
@@ -48,11 +57,12 @@ xx\pdf_link_user:nnn {url}{/A<</Type/Action/S/URI/URI(www.blub.de)>>}{blbl\\blb\
 
 \par\bigskip
 xxx
-\driver_pdf_link_user:nnn
+\driver_pdf_link_begin_user:nnw
  {/C~[1~0~0]
  /Border [0.5~0.5~0.5]}
  {/A<</Type/Action/S/URI/URI(www.blub.de)>>}
- {long~text~text~text~text~text~text~text~text}
+ long~text~text~text~text~text~text~text~text
+\driver_pdf_link_end: 
 
 \url{www.blubblubblub.de}
 \section{a}\label{a}
@@ -76,7 +86,7 @@ blblb
 %endobj
 \leavevmode
 \ExplSyntaxOn
-\driver_pdf_startlink_user:nn
+\driver_pdf_link_begin_user:nnw
  {
   /Border~[0~0~1]
  }
@@ -89,7 +99,7 @@ blblb
        >>
  }
   some link
-\driver_pdf_endlink:
+\driver_pdf_link_end:
 \ExplSyntaxOff
 
 blub





More information about the latex3-commits mailing list