[latex3-commits] [git/LaTeX3-latex3-pdfresources] renamedict77: renamed annot/link commands. Need to sort the default attributes (2b78d36)
Ulrike Fischer
fischer at troubleshooting-tex.de
Tue Apr 14 18:50:29 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : renamedict77
Link : https://github.com/latex3/pdfresources/commit/2b78d36ece5e7366a7581f4ea19feefdda95f3b7
>---------------------------------------------------------------
commit 2b78d36ece5e7366a7581f4ea19feefdda95f3b7
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Tue Apr 14 18:50:29 2020 +0200
renamed annot/link commands. Need to sort the default attributes
>---------------------------------------------------------------
2b78d36ece5e7366a7581f4ea19feefdda95f3b7
dicthandler.tex | 9 ++
hgeneric-experimental.def | 108 +++++++++----------
hyperreflinktypes.tex | 3 +-
pdfresources.dtx | 239 +++++++++++++++++++++++--------------------
testfiles-dvips/annot.pvt | 4 +-
testfiles-dvips/linkhook.pvt | 33 +++---
testfiles/annot.pvt | 5 +-
testfiles/linkhook.pvt | 32 +++---
testfiles/ocgcolorlinks.pvt | 3 +-
9 files changed, 225 insertions(+), 211 deletions(-)
diff --git a/dicthandler.tex b/dicthandler.tex
index cbb05c5..35918f4 100644
--- a/dicthandler.tex
+++ b/dicthandler.tex
@@ -34,6 +34,15 @@
> {Page/Resources/Pattern} /? handler
+local dictionaries
+
+annot/Link/URI
+annot/Link/GoTo
+annot/Link/GoToR
+annot/Link/Named
+annot/Link/File
+
+
%%% Sorting Page / PageN mess
Page: code /resources for all pages (starting from first use) = \pageattr
diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index 9fe1fff..490dfa5 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -152,7 +152,7 @@
\providecommand*\@pdfview{XYZ}
-\pdf_link_margin:n { 1pt }
+\pdfannot_link_margin:n { 1pt }
%%%%%%%%%%
% variants
@@ -214,27 +214,23 @@
{
\bool_if:NT \l__hyp_pdfa_bool
{
- \hook_put:nnnn
- { pdf }
- { link_URI_attr }
+ \pdfdict_put:nnn
+ {annot/Link/URI}
{ F }
{ 4 }
- \hook_put:nnnn
- { pdf }
- { link_GoTo_attr }
+ \pdfdict_put:nnn
+ {annot/Link/GoTo}
{ F }
{ 4 }
- \hook_put:nnnn
- { pdf }
- { link_GoToR_attr }
+ \pdfdict_put:nnn
+ {annot/Link/GoToR}
{ F }
{ 4 }
- \hook_put:nnnn
- { pdf }
- { link_Named_attr }
+ \pdfdict_put:nnn
+ {annot/Link/Named}
{ F }
{ 4 }
}
@@ -248,27 +244,25 @@
\cs_new_protected:Npn \Hy at EXPsetpdfborder
{
- \seq_map_inline:Nn \c_pdf_link_types_seq
+ \seq_map_inline:Nn \c_pdfannot_link_types_seq
{
\tl_if_empty:NTF \@pdfborder
{
- \hook_remove:nnn { pdf } { link_##1_attr } { Border }
+ \pdfdict_remove:nn {annot/Link/##1}{Border}
}
{
- \hook_put:nnnn
- { pdf }
- { link_##1_attr }
+ \pdfdict_put:nnx
+ {annot/Link/##1}
{ Border }
{ [\@pdfborder] }
}
\tl_if_empty:NTF \@pdfborderstyle
{
- \hook_remove:nnn { pdf }{ link_##1_attr } { BS }
+ \pdfdict_remove:nn {annot/Link/##1} { BS }
}
{
- \hook_put:nnnn
- { pdf }
- { link_##1_attr }
+ \pdfdict_put:nnx
+ {annot/Link/##1}
{ BS }
{ <<\@pdfborderstyle>> }
}
@@ -278,16 +272,15 @@
% highlight
\cs_new_protected:Npn \Hy at EXPsetpdfhighlight
{
- \seq_map_inline:Nn \c_pdf_link_types_seq
+ \seq_map_inline:Nn \c_pdfannot_link_types_seq
{
\tl_if_empty:NTF \@pdfhighlight
{
- \hook_remove:nnn { pdf } { link_##1_attr }{ H }
+ \pdfdict_remove:nn {annot/Link/##1}{ H }
}
{
- \hook_put:nnnn
- { pdf }
- { link_##1_attr }
+ \pdfdict_put:nnx
+ {annot/Link/##1}
{ H }
{ \@pdfhighlight }
}
@@ -297,18 +290,17 @@
% bordercolor
\cs_new_protected:Npn \Hy at EXPsetbordercolor
{
- \seq_map_inline:Nn \c_pdf_link_types_seq
+ \seq_map_inline:Nn \c_pdfannot_link_types_seq
{
\tl_if_exist:cTF { @\prop_item:Nn\c__hyp_map_linktypes_prop{##1}bordercolor }
{
- \hook_put:nnnn
- { pdf }
- { link_##1_attr }
- { C }
- { [\tl_use:c {@\prop_item:Nn\c__hyp_map_linktypes_prop{##1}bordercolor}] }
+ \pdfdict_put:nnx
+ {annot/Link/##1}
+ { C }
+ { [\tl_use:c {@\prop_item:Nn\c__hyp_map_linktypes_prop{##1}bordercolor}] }
}
{
- \hook_remove:nnn { pdf } { link_##1_attr } { C }
+ \pdfdict_remove:nn {annot/Link/##1} { C }
}
}
}
@@ -594,7 +586,7 @@
\cs_set_protected:Npn \setpdflinkmargin #1
{
- \pdf_link_margin:n { #1 }
+ \pdfannot_link_margin:n { #1 }
}
% internal definitions for anchors (destinations) and links to destinations.
@@ -629,14 +621,14 @@
}
}
\exp_args:No
- \pdf_link_goto_begin:nw { \l__hyp_destname_tmpa_tl }
+ \pdfannot_link_goto_begin:nw { \l__hyp_destname_tmpa_tl }
\Hy at colorlink\@linkcolor
}
\cs_new_protected:Npn \__hyp_link_dest_end:
{
\Hy at endcolorlink
- \pdf_link_goto_end:
+ \pdfannot_link_goto_end:
}
%% hyperref commands for destinations (anchor) and links to destinations
@@ -695,9 +687,8 @@
\mode_leave_vertical:
%Subtype and A could probably also be handled with hooks if needed
%but checks for all drivers should be done then.
- \pdf_link_user:nnn { URI }
+ \pdfannot_link:nnn { URI }
{
- /Subtype /Link
/A
<<
% the action dictionary has no hook!
@@ -732,10 +723,9 @@
\__hyp_pstringdef:Nn \l__hyp_destname_tmpa_tl { #3 }
\Hy at MakeRemoteAction
\mode_leave_vertical:
- \pdf_link_user:nnn %expansion??
+ \pdfannot_link:nnn %expansion??
{ GoToR }
{
- /Subtype /Link
/A<<
/F( \l__hyp_filename_tmpa_tl )
/S/GoToR
@@ -775,10 +765,9 @@
%\Hy at pstringdef\Hy at pstringF{#1}%
%\Hy at pstringdef\Hy at pstringP{#3}%
\mode_leave_vertical:
- \pdf_link_user:nnn %expansion?
+ \pdfannot_link:nnn %expansion?
{ Launch }
{
- /Subtype /Link
/A<<
/F( \l__hyp_filename_tmpa_tl )
/S/Launch
@@ -1453,15 +1442,14 @@
\Hy at Acrobatmenu{#1}{#2}{%
\mode_leave_vertical:
\EdefEscapeName\Hy at temp@menu{#1}%
- \pdf_link_user:nnn { Named }
+ \pdfannot_link:nnn { Named }
{
- /Subtype /Link
- /A<<
- /S/Named
- /N/\Hy at temp@menu
- \Hy at href@nextactionraw
- >>
-
+ /A
+ <<
+ /S/Named
+ /N/\Hy at temp@menu
+ \Hy at href@nextactionraw
+ >>
}
{
\Hy at colorlink\@menucolor#2
@@ -1521,7 +1509,7 @@
\exp_args:Nx\HyField@@AddToFields
{
%\pdf_link_last:
- \pdf_annotation_last:
+ \pdfannot_box_last:
}
\ifx\Fld at calculate@code\ltx at empty
\else
@@ -1538,7 +1526,7 @@
}
{
% \pdf_link_last:
- \pdf_annotation_last:
+ \pdfannot_box_last:
}
}
\fi
@@ -1575,7 +1563,7 @@
{
\pdfdict_put:nnx { Catalog / AcroForm } { Fields }{##1}
%\pdfdict_show:n { Catalog / AcroForm }
- \seq_show:c { g__pdf_/Catalog/AcroForm/Fields_seq}
+ %\seq_show:c { g__pdf_/Catalog/AcroForm/Fields_seq} %!!!!!
}
\prop_if_empty:NF \g__hyp_AcroForm_CoFields_prop
{
@@ -1732,7 +1720,7 @@
\leavevmode
\HyAnn at AbsPageLabel
\Hy at escapeform\PDFForm at Text
- \pdf_annotation:nnnn
+ \pdfannot_box:nnnn
{\Fld at width}
{\Fld at height}
{0pt} %is this correct?
@@ -1830,7 +1818,7 @@
\leavevmode
\HyAnn at AbsPageLabel
\Hy at escapeform\PDFForm at Radio
- \pdf_annotation:nnnn
+ \pdfannot_box:nnnn
{\Fld at width}
{\Fld at height}
{0pt} %is this correct?
@@ -1897,7 +1885,7 @@
\HyAnn at AbsPageLabel
\Hy at escapeform\PDFForm at Push
\hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}}
- \pdf_annotation:nnnn
+ \pdfannot_box:nnnn
{\box_wd:N\l_tmpa_box}
{\box_ht:N\l_tmpa_box}
{\box_dp:N\l_tmpa_box} %is this correct?
@@ -1928,7 +1916,7 @@
\HyAnn at AbsPageLabel
\Hy at escapeform\PDFForm at Submit
\hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}}
- \pdf_annotation:nnnn
+ \pdfannot_box:nnnn
{\box_wd:N\l_tmpa_box}
{\box_ht:N\l_tmpa_box}
{\box_dp:N\l_tmpa_box} %is this correct?
@@ -1967,7 +1955,7 @@
\HyAnn at AbsPageLabel
\Hy at escapeform\PDFForm at Reset
\hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}}
- \pdf_annotation:nnnn
+ \pdfannot_box:nnnn
{\box_wd:N\l_tmpa_box}
{\box_ht:N\l_tmpa_box}
{\box_dp:N\l_tmpa_box} %is this correct?
@@ -2000,7 +1988,7 @@
\mode_leave_vertical:
\HyAnn at AbsPageLabel
\Hy at escapeform\PDFForm at Check
- \pdf_annotation:nnnn
+ \pdfannot_box:nnnn
{\Fld at width}
{\Fld at height}
{0pt} %is this correct?
diff --git a/hyperreflinktypes.tex b/hyperreflinktypes.tex
index 0ca0b3a..c2a98ab 100644
--- a/hyperreflinktypes.tex
+++ b/hyperreflinktypes.tex
@@ -16,7 +16,7 @@ Internal links
\find at pdflink{#1}{#2} --> new name: \__hyp_link_dest_begin:nw
defined in driver,
used only in driver
- -> \pdf_link_begin_goto:nnw { link } { #2 }
+ -> \pdf_annot_link_goto_begin:nnw { link } { #2 }
\expandafter\Hy at colorlink\csname @#1color\endcsname
\hyper at link
@@ -97,4 +97,3 @@ used in hyperref inside
For naming consistency it would make sense to define a \hyper at linklaunch which is used by
\@hyper at launch.
See for syntax https://tex.stackexchange.com/a/245098/2388
-
\ No newline at end of file
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 68ab9c8..52307c4 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -2389,7 +2389,10 @@
{pdf at abspage}
{0}
}
- \@@_dict_gnew:n { backend_Page\l_@@_tmpa_tl/Resources/Properties }
+ \@@_dict_if_exist:nF { backend_Page\l_@@_tmpa_tl/Resources/Properties }
+ {
+ \@@_dict_gnew:n { backend_Page\l_@@_tmpa_tl/Resources/Properties }
+ }
\@@_dict_handler_put:nxx
{ backend_Page\l_@@_tmpa_tl/Resources/Properties }
{ l3pdf\int_use:N\g_@@_backend_resourceid_int }
@@ -2852,72 +2855,89 @@
% \end{macro}
% \end{macro}
%
-%\subsection{Annotation}
-%\subsubsection{Annotation/backend}
-% The backend commands are already in the driver:
-% \cs{@@_backend_annotation:nnnn} and \cs{@@_backend_annotation_last:}
-%
-% \subsubsection{Annotation/management }
+%\subsection{Annotations}
% \begin{NOTE}{UF}
+% The code/naming tries to unify general annotations and the special type of
+% link under a common name.
% regarding naming and relation of annotation commands see
% https://github.com/FrankMittelbach/AccessiblePDF/issues/73
% \end{NOTE}
-% \begin{function}[added = 2019-09-05]
-% {\pdf_annotation:nnnn}
+
+%\subsubsection{Annotations / backend}
+% The backend commands are already in the driver:
+% \cs{@@_backend_annotation:nnnn} and \cs{@@_backend_annotation_last:}
+% \cs{@@_backend_link_begin_user:nnw}, etc
+%
+% \subsubsection{ general Annotation/management }
+% \begin{function}[added = 2020-04-14] %!!!type or not type? Syntax for type???
+% {\pdfannot:nnn}
% \begin{syntax}
-% \cs{pdf_annotation:nnnn} \Arg{width} \Arg{height} \Arg{depth} \Arg{annot spec}
+% \cs{pdfannot:nnn} \Arg{type} \Arg{action spec} \Arg{annot text}
% \end{syntax}
-% This creates an /Type/Annot object.
+% This creates an /Type/Annot object whose rectangle is defined by \Arg{annot text}.
+% If \Arg{type} is a known type the hooks of this type are executed at the begin and
+% the end, and the attribute dictionary of the type is inserted as attributes.
+% This allows to create for example a link annotation which shares border settings
+% with other links. \Arg{type} should e.g. be |Link/URI|. %!!!!!syntax?
+% \end{function}
+% %!!!!!! should there be a version without type??
+% \begin{function}[added = 2019-09-05, update 2020-04-14]
+% {\pdfannot_box:nnnn}
+% \begin{syntax}
+% \cs{pdfannot_box:nnnn} \Arg{width} \Arg{height} \Arg{depth} \Arg{annot spec}
+% \end{syntax}
+% This creates an /Type/Annot object with the given dimensions.
% \end{function}
% \begin{function}[added = 2020-03-30]
-% {\pdf_annotation:nnnnn}
+% {\pdfannot_box:nnnnn}
% \begin{syntax}
-% \cs{pdf_annotation:nnnn} \Arg{type} \Arg{width} \Arg{height} \Arg{depth} \Arg{annot spec}
+% \cs{pdfannot_box:nnnn} \Arg{type} \Arg{width} \Arg{height} \Arg{depth} \Arg{annot spec}
% \end{syntax}
-% This creates an /Type/Annot object, which uses the |type-attr| hook in the attributes.
+% This creates an /Type/Annot object.
+% If \Arg{type} is a known type the hooks of this type are executed at the begin and
+% the end, and the attribute dictionary of the type is inserted as attributes.
% This allows to create for example a link annotation which shares border settings
-% with other links. \Arg{type} should e.g. be |link_URI|.
+% with other links. \Arg{type} should e.g. be |Link/URI|. %!!!!!syntax?
% \end{function}
% \begin{function}[added = 2019-09-05]
-% {\pdf_annotation_last:}
+% {\pdfannot_box_last:}
% \begin{syntax}
-% \cs{pdf_annotation_last:}
+% \cs{pdfannot_box_last:}
% \end{syntax}
% This retrieves the object reference of the last annotation created. This is not
% available with xetex.
% \end{function}
% \begin{macrocode}
-\cs_new_protected:Npn \pdf_annotation:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \pdfannot_box:nnnn #1 #2 #3 #4
{
\@@_backend_annotation:nnnn {#1}{#2}{#3}{#4}
}
-\cs_new:Npn \pdf_annotation_last:
+\cs_new:Npn \pdfannot_box_last:
{
\@@_backend_annotation_last:
}
-\cs_new_protected:Npn \pdf_annotation:nnnnn #1 #2 #3 #4 #5
+\cs_new_protected:Npn \pdfannot_box:nnnnn #1 #2 #3 #4 #5
{
\exp_args:Nx
\@@_backend_annotation:nnnn {#2}{#3}{#4}
{
- \prop_if_exist:cT { l_@@_hook_#1_attr_prop }
+ \@@_dict_if_exist:nT { annot/#1 }
{
- \prop_map_function:cN
- { l_@@_hook_#1_attr_prop }
- \@@_dict_item:nn
+ \@@_dict_map_dict_item:n {annot/#1}
}
#5
}
}
+
% \end{macrocode}
%
-% \subsection{Links}\label{sec:links}
+% \subsection{Annotations, subtype Link}\label{sec:links}
% Packages like hyperref, ocgx2 and tagpdf all wants to add code
-% to links/annotation. So we need commands to start and end a link which allows
+% to link annotation. So we need commands to start and end a link which allows
% packages to add their code through hooks. There are three places in a link where
% hooks are needed: At the begin (for example for a structure command or color),
% in the \emph{attr spec} of the link (for example for the border), and
@@ -2953,101 +2973,103 @@
% link |\hyper at link|, |\find at pdflink|
% menu |\Acrobatmenu|
% \end{NOTE}
-% \begin{variable}[added = 2020-03-12]{ \c_pdf_link_types_seq }
+% \begin{variable}[added = 2020-03-12]{ \c_pdfannot_link_types_seq }
% This constant sequence contains the list of currently supported link types
-% for which hooks exist.
+% for which hooks and dictionaries exist.
% \end{variable}
%
% \begin{macrocode}
-\seq_const_from_clist:Nn \c_pdf_link_types_seq { URI , GoToR , Launch , GoTo, Named }
+\seq_const_from_clist:Nn \c_pdfannot_link_types_seq { URI , GoToR , Launch , GoTo, Named }
-\seq_map_inline:Nn \c_pdf_link_types_seq
+\seq_map_inline:Nn \c_pdfannot_link_types_seq
{
- \prop_new:c { l_@@_hook_link_#1_attr_prop }
- \seq_new:c { l_@@_hook_link_#1_begin_seq }
- \seq_new:c { l_@@_hook_link_#1_end_seq }
+ \@@_dict_new:n { annot/Link/#1 }
+ \seq_new:c { l_@@_hook_annot/Link/#1_begin_seq }
+ \seq_new:c { l_@@_hook_annot/Link/#1_end_seq }
}
% \end{macrocode}
-% \subsubsection{Links/management}
-% \begin{function}[added = 2020-03-12]{ \pdf_link_user:nnn }
+% \subsubsection{Annotations, subtype Link /management}
+% \begin{function}[added = 2020-03-12, updates 2020]{ \pdfannot_link:nnn }
% \begin{syntax}
-% \cs{pdf_link_user:nnn} \Arg{type} \Arg{user action spec} \Arg{link text}
+% \cs{pdfannot_link:nnn} \Arg{type} \Arg{user action spec} \Arg{link text}
% \end{syntax}
% This creates a link around the \Arg{link text} with the specified
% \Arg{user action spec}\footnote{The wording follows the pdftex documentation}.
-% If the type is one of the known types the attributes stored in the attribute
-% hook of type \Arg{type} are inserted as \emph{attr spec} and the code in
+% \texttt{/Subtype/Link} is added automatically.
+% If \texttt{annot/Link/}\Arg{type} is a known local dictionary
+% attributes stored in dictionary of type \Arg{type} are inserted as
+% \emph{attr spec} and the code in
% the begin and end hook is executed before and after the link. \Arg{type} should
% normally be identical to the value of the |/S| key in the action dictionary.
% As example
% \begin{verbatim}
-% \pdf_link_user:nnn { URI }
+% \pdfannot_link:nnn { URI }
% {
-% /Subtype /Link
-% /A<<
-% /Type/Action
-% /S/URI
-% /URI(https://www.latex-project.org)
-% >>
+% /A
+% <<
+% /Type/Action
+% /S/URI
+% /URI(https://www.latex-project.org)
+% >>
% }
% { link text }
% \end{verbatim}
% \end{function}
%
% \begin{macrocode}
-\cs_new_protected:Nn \pdf_link_user:nnn %#1 type (URI, GoTo etc),
+\cs_new_protected:Nn \pdfannot_link:nnn %#1 type (URI, GoTo etc),
%#2 action spec, #3 link text
{
- \seq_if_exist:cT { l_@@_hook_link_#1_begin_seq }
+ \seq_if_exist:cT { l_@@_hook_annot/Link/#1_begin_seq }
{
- \seq_use:cn { l_@@_hook_link_#1_begin_seq }{}
+ \seq_use:cn { l_@@_hook_annot/Link/#1_begin_seq }{}
}
\mode_leave_vertical:
\exp_args:Nxx %xetex needs expansion
\@@_backend_link_begin_user:nnw
{
- \prop_if_exist:cT { l_@@_hook_link_#1_attr_prop }
+ \@@_dict_if_exist:nT { annot/Link/#1 }
{
- \prop_map_function:cN
- { l_@@_hook_link_#1_attr_prop }
- \@@_dict_item:nn
+ \@@_dict_map_dict_item:n {annot/Link/#1}
}
}
{
+ /Subtype/Link
#2
}
#3
\@@_backend_link_end:
- \seq_if_exist:cT { l_@@_hook_link_#1_end_seq }
+ \seq_if_exist:cT { l_@@_hook_annot/Link/#1_end_seq }
{
- \seq_use:cn { l_@@_hook_link_#1_end_seq }{}
+ \seq_use:cn { l_@@_hook_annot/Link/#1_end_seq }{}
}
}
% \end{macrocode}
-% \begin{function}[added = 2020-03-12]{ \pdf_link_begin_user:nnw, \pdf_link_end:n }
+% \begin{function}[added = 2020-03-12]{ \pdfannot_link_begin:nnw, \pdfannot_link_end:n }
% \begin{syntax}
-% \cs{pdf_link_begin_user:nnw} \Arg{type} \Arg{user action spec} \meta{content}
-% \cs{pdf_link_end:n} \Arg{type}
+% \cs{pdfannot_link_begin:nnw} \Arg{type} \Arg{user action spec} \meta{content}
+% \cs{pdfannot_link_end:n} \Arg{type}
% \end{syntax}
% This creates a link around the \meta{content} with the specified
% \meta{user action spec} (e.g. an /A dictionary with an URI) or
% \meta{destination} (a name as defined with the
% first argument of \cs{pdf_destination:nn}).
-% In contrast to \cs{pdf_link_user:nnn} this function
+% \texttt{/Subtype/Link} is added automatically.
+% In contrast to \cs{pdfannot_link:nnn} this function
% does not absorb the argument when finding the \meta{content}, and so can
% be used in circumstances where the \meta{content} may not be a simple
% argument.
-% If the type is one of the known types the attributes stored in the attribute
-% hook of type \meta{type} are inserted as \emph{attr spec} and the code in
-% the begin and end hook is executed before and after the link. As example
+% If \texttt{annot/Link/}\Arg{type} is a known local dictionary
+% attributes stored in dictionary of type \Arg{type} are inserted as
+% \emph{attr spec} and the code in the begin and end hook is executed
+% before and after the link. As example
% \begin{verbatim}
-% \pdf_link_begin_user:nnw { URI }
+% \pdfannot_link_begin:nnw { URI }
% {
-% /Subtype /Link
% /A<<
% /Type/Action
% /S/URI
@@ -3055,83 +3077,80 @@
% >>
% }
% link text
-% \pdf_link_end:n { URI }
+% \pdfannot_link_end:n { URI }
% \end{verbatim}
% \end{function}
% \begin{macrocode}
-\cs_new_protected:Npn \pdf_link_begin_user:nnw #1 #2 %#1 type, #2 action spec
+\cs_new_protected:Npn \pdfannot_link_begin:nnw #1 #2 %#1 type, #2 action spec
{
- \seq_if_exist:cT { l_@@_hook_link_#1_begin_seq }
+ \seq_if_exist:cT { l_@@_hook_annot/Link/#1_begin_seq }
{
- \seq_use:cn { l_@@_hook_link_#1_begin_seq }{}
+ \seq_use:cn { l_@@_hook_annot/Link/#1_begin_seq }{}
}
\exp_args:Nxx %xetex needs expansion
\@@_backend_link_begin_user:nnw
{
- \prop_if_exist:cT { l_@@_hook_link_#1_attr_prop }
+ \@@_dict_if_exist:nT { annot/Link/#1 }
{
- \prop_map_function:cN
- { l_@@_hook_link_#1_attr_prop }
- \@@_dict_item:nn
+ \@@_dict_map_dict_item:n {annot/Link/#1}
}
- }
- { #2 }
+ }
+ { #2 }
}
-\cs_new_protected:Nn \pdf_link_end:n %#1 type, e.g. url
+\cs_new_protected:Nn \pdfannot_link_end:n %#1 type, e.g. url
{
\@@_backend_link_end:
- \seq_if_exist:cT {l_@@_hook_link_#1_end_seq}
+ \seq_if_exist:cT {l_@@_hook_annot/Link/#1_end_seq}
{
- \seq_use:cn { l_@@_hook_link_#1_end_seq }{}
+ \seq_use:cn { l_@@_hook_annot/Link/#1_end_seq }{}
}
}
% \end{macrocode}
-% \begin{function}[updated = 2020-03-30]{ \pdf_link_goto_begin:nw, \pdf_link_goto_end: }
+% \begin{function}[updated = 2020-03-30]{ \pdfannot_link_goto_begin:nw, \pdfannot_link_goto_end: }
% \begin{syntax}
-% \cs{pdf_link_goto_begin:nw} \Arg{destination} \meta{content}
-% \cs{pdf_link_goto_end:}
+% \cs{pdfannot_link_goto_begin:nw} \Arg{destination} \meta{content}
+% \cs{pdfannot_link_goto_end:}
% \end{syntax}
% This is a special, shorter version for links to internal destinations. It always
-% uses the hooks of the |GoTo| link type.
+% uses the hooks and dictionary of the |GoTo| link type.
% \end{function}
% \begin{macrocode}
-\cs_new_protected:Npn \pdf_link_goto_begin:nw #1 %#1 destination
+\cs_new_protected:Npn \pdfannot_link_goto_begin:nw #1 %#1 destination
{
- \seq_use:cn { l_@@_hook_link_GoTo_begin_seq }{}
+ \seq_use:cn { l_@@_hook_annot/Link/GoTo_begin_seq }{}
\exp_args:Nxx %xetex needs expansion
\@@_backend_link_begin_goto:nnw
{
- \prop_map_function:cN
- { l_@@_hook_link_GoTo_attr_prop }
- \@@_dict_item:nn
+ \@@_dict_map_dict_item:n {annot/Link/GoTo}
+
}
{ #1 }
}
-\cs_new_protected:Nn \pdf_link_goto_end:
+\cs_new_protected:Nn \pdfannot_link_goto_end:
{
\@@_backend_link_end:
- \seq_use:cn { l_@@_hook_link_GoTo_end_seq }{}
+ \seq_use:cn { l_@@_hook_annot/Link/GoTo_end_seq }{}
}
% \end{macrocode}
-% \begin{function}[added = 2020-03-12]{ \pdf_link_last: }
+% \begin{function}[added = 2020-03-12]{ \pdfannot_link_last: }
% This retrieves the object reference a previously link created with the commands
% above
% \end{function}
% \begin{macrocode}
\cs_set_eq:NN \pdf_link_last: \@@_backend_link_last:
% \end{macrocode}
-%
-% \begin{function}[added = 2020-03-12]{ \pdf_link_margin:n }
+% %!!!! only annot link or also annot??
+% \begin{function}[added = 2020-03-12]{ \pdfannot_link_margin:n }
% \begin{syntax}
-% \cs{pdf_link_margin:n} \Arg{dimen}
+% \cs{pdfannot_link_margin:n} \Arg{dimen}
% \end{syntax}
% This sets the dimension of the link margin.
% \end{function}
% \begin{macrocode}
-\cs_set_eq:NN \pdf_link_margin:n \@@_backend_link_margin:n
+\cs_set_eq:NN \pdfannot_link_margin:n \@@_backend_link_margin:n
% \end{macrocode}
% \subsection{Destinations}
@@ -3373,25 +3392,25 @@
\seq_put_left:cn { l__#1_hook_#2_seq } { #3 }
}
-\cs_new:Nn \hook_put:nnnn
- {
- \prop_put:cnn { l__#1_hook_#2_prop } { #3 }{ #4 }
- }
-
-\cs_new:Nn \hook_gput:nnnn
- {
- \prop_gput:cnn { g__#1_hook_#2_prop } { #3 }{ #4 }
- }
-
-\cs_new:Nn \hook_remove:nnn
- {
- \prop_remove:cn { l__#1_hook_#2_prop } { #3 }
- }
+%\cs_new:Nn \hook_put:nnnn
+% {
+% \prop_put:cnn { l__#1_hook_#2_prop } { #3 }{ #4 }
+% }
+%
+%\cs_new:Nn \hook_gput:nnnn
+% {
+% \prop_gput:cnn { g__#1_hook_#2_prop } { #3 }{ #4 }
+% }
-\cs_new:Nn \hook_gremove:nnn
- {
- \prop_gremove:cn { g__#1_hook_#2_prop } { #3 }
- }
+%\cs_new:Nn \hook_remove:nnn
+% {
+% \prop_remove:cn { l__#1_hook_#2_prop } { #3 }
+% }
+%
+%\cs_new:Nn \hook_gremove:nnn
+% {
+% \prop_gremove:cn { g__#1_hook_#2_prop } { #3 }
+% }
% \end{macrocode}
% \subsection{Passing external information to hooks}
% hooks sometimes wants to know something about the arguments of the surrounding command.
diff --git a/testfiles-dvips/annot.pvt b/testfiles-dvips/annot.pvt
index dfd2e0c..e048a26 100644
--- a/testfiles-dvips/annot.pvt
+++ b/testfiles-dvips/annot.pvt
@@ -13,8 +13,8 @@
% just to avoid to have to escape every space ...
\def\testcontent{/Subtype/Widget/F 4/T(abc)/FT/Tx/Q 0/BS<</W 1 /S /S>>/MK<</BC[1 0 0]/BG[1 1 1]>>/DA(/Helv 10 Tf 0 0 0 rg)/DV()/V()}
\ExplSyntaxOn
-\cs_generate_variant:Nn \pdf_annotation:nnnn {nnno}
-xx\pdf_annotation:nnno
+\cs_generate_variant:Nn \pdfannot_box:nnnn {nnno}
+xx\pdfannot_box:nnno
{1cm}
{1cm}
{0pt}
diff --git a/testfiles-dvips/linkhook.pvt b/testfiles-dvips/linkhook.pvt
index cca9233..45a74b6 100644
--- a/testfiles-dvips/linkhook.pvt
+++ b/testfiles-dvips/linkhook.pvt
@@ -25,33 +25,32 @@
\ExplSyntaxOn\makeatletter
\hook_put_left:nnn
{ pdf }
- { link_URI_begin }
+ { annot_link_URI_begin }
{
begin~url
}
-\hook_put:nnnn
- { pdf }
- { link_URI_attr }
- { StructParent }
- { 123 }
+ \pdfdict_put:nnn
+ {annot/Link/URI}
+ { StructParent }
+ { 123 }
+
\hook_put_right:nnn
{ pdf }
- { link_URI_end }
+ { annot_link_URI_end }
{
end~url
}
-\hook_put:nnnn
- { pdf }
- { link_URI_attr }
- { Contents }
- { (url) }
+ \pdfdict_put:nnn
+ {annot/Link/URI}
+ { Contents }
+ { (url) }
+
+ \pdfdict_put:nnn
+ {annot/Link/GoTo}
+ { Contents }
+ { (ref) }
-\hook_put:nnnn
- { pdf }
- { link_GoTo_attr }
- { Contents }
- { (ref) }
\ExplSyntaxOff
\begin{document}
diff --git a/testfiles/annot.pvt b/testfiles/annot.pvt
index 582521d..0209ba8 100644
--- a/testfiles/annot.pvt
+++ b/testfiles/annot.pvt
@@ -9,8 +9,9 @@
% just to avoid to have to escape every space ...
\def\testcontent{/Subtype/Widget/F 4/T(abc)/FT/Tx/Q 0/BS<</W 1 /S /S>>/MK<</BC[1 0 0]/BG[1 1 1]>>/DA(/Helv 10 Tf 0 0 0 rg)/DV()/V()}
\ExplSyntaxOn
-\cs_generate_variant:Nn \pdf_annotation:nnnn {nnno}
-xx\pdf_annotation:nnno
+\cs_generate_variant:Nn \pdfannot_box:nnnnn {nnnno}
+xx\pdfannot_box:nnnno
+ {}
{1cm}
{1cm}
{0pt}
diff --git a/testfiles/linkhook.pvt b/testfiles/linkhook.pvt
index 1f48361..a1b1db3 100644
--- a/testfiles/linkhook.pvt
+++ b/testfiles/linkhook.pvt
@@ -17,33 +17,31 @@
\ExplSyntaxOn\makeatletter
\hook_put_left:nnn
{ pdf }
- { link_URI_begin }
+ { annot/Link/URI_begin }
{
begin~url
}
-\hook_put:nnnn
- { pdf }
- { link_URI_attr }
- { StructParent }
- { 123 }
+ \pdfdict_put:nnn
+ {annot/Link/URI}
+ { StructParent }
+ { 123 }
+
\hook_put_right:nnn
{ pdf }
- { link_URI_end }
+ { annot/Link/URI_end }
{
end~url
}
-\hook_put:nnnn
- { pdf }
- { link_URI_attr }
- { Contents }
- { (url) }
+ \pdfdict_put:nnn
+ {annot/Link/URI}
+ { Contents }
+ { (url) }
-\hook_put:nnnn
- { pdf }
- { link_GoTo_attr }
- { Contents }
- { (ref) }
+ \pdfdict_put:nnn
+ {annot/Link/GoTo}
+ { Contents }
+ { (ref) }
\ExplSyntaxOff
\begin{document}
diff --git a/testfiles/ocgcolorlinks.pvt b/testfiles/ocgcolorlinks.pvt
index e1e6a3e..943c5e1 100644
--- a/testfiles/ocgcolorlinks.pvt
+++ b/testfiles/ocgcolorlinks.pvt
@@ -4,8 +4,9 @@
\usepackage[verbose,ocgcolorlinks,customdriver=hgeneric-experimental]
{hyperref}
-\hypupdateattribute
+
\begin{document}
+\hypupdateattribute
\section{hyperref colors / colorlinks}\label{sec}
\begin{tabular}{lll}
More information about the latex3-commits
mailing list.