summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty217
1 files changed, 118 insertions, 99 deletions
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty
index 9bb57f2bb38..03bfb78a98d 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty
@@ -1,110 +1,129 @@
-\ProvidesExplPackage {tagpdf-attr-code} {2019/07/02} {0.61}
- {part of tagpdf - code related to attributes and attribute classes}
+%%
+%% This is file `tagpdf-attr-code.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% tagpdf-struct.dtx (with options: `attr')
+%%
+%% Copyright (C) 2019 Ulrike Fischer
+%%
+%% It may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License (LPPL), either version 1.3c of
+%% this license or (at your option) any later version. The latest
+%% version of this license is in the file:
+%%
+%% https://www.latex-project.org/lppl.txt
+%%
+%% This file is part of the "tagpdf bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% File: tagpdf-struct.dtx
-% the obj is written in tagpdf-tree-code.
+\ProvidesExplPackage {tagpdf-attr-code} {2021/02/23} {0.80}
+ {part of tagpdf - code related to attributes and attribute classes}
-\seq_new:N \g__uftag_attr_class_used_seq
-\prop_new:N \g__uftag_attr_objnum_prop %will contain obj num of used attributes
-\prop_new:N \g__uftag_attr_entries_prop
-\tl_new:N \g__uftag_attr_class_content_tl
-\tl_new:N \l__uftag_attr_objtmp_tl
-\tl_new:N \l__uftag_attr_value_tl
+\seq_new:N \g__tag_attr_class_used_seq
+\prop_new:N \g__tag_attr_objref_prop %will contain obj num of used attributes
+\prop_new:N \g__tag_attr_entries_prop
+\tl_new:N \g__tag_attr_class_content_tl
+\tl_new:N \l__tag_attr_objtmp_tl
+\tl_new:N \l__tag_attr_value_tl
-\cs_new_protected:Nn \__uftag_attr_new_entry:nn %#1:name, #2: content
- {
- \prop_gput:Nnn \g__uftag_attr_entries_prop
- {#1}{#2}
- }
+\cs_new_protected:Nn \__tag_attr_new_entry:nn %#1:name, #2: content
+ {
+ \prop_gput:Nnn \g__tag_attr_entries_prop
+ {#1}{#2}
+ }
-\keys_define:nn { uftag / setup }
- {
- newattribute .code:n =
- {
- \__uftag_attr_new_entry:nn #1
- }
- }
-
-
-% the key for the structure:
-\keys_define:nn { uftag / struct }
-{
- attribute-class .code:n =
- {
- \clist_set:No \l_tmpa_clist { #1 }
- \seq_set_from_clist:NN \l_tmpa_seq \l_tmpa_clist
- \seq_map_inline:Nn \l_tmpa_seq
- {
- \prop_if_in:NnF \g__uftag_attr_entries_prop {##1}
+\keys_define:nn { __tag / setup }
+ {
+ newattribute .code:n =
{
- \msg_error:nnn { uftag } { attr-unknown } { ##1 }
+ \__tag_attr_new_entry:nn #1
}
- \seq_gput_left:Nn\g__uftag_attr_class_used_seq { ##1}
- }
- \seq_set_map:NNn \l_tmpb_seq \l_tmpa_seq
- {
- /##1
- }
- \tl_set:Nx \l_tmpa_tl
- {
- \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{[}
- \seq_use:Nn \l_tmpb_seq { \c_space_tl }
- \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{]}
- }
- \int_compare:nT { \seq_count:N \l_tmpa_seq > 0 }
- {
- \__uftag_prop_gput:cnx
- { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop }
- { C }
- { \l_tmpa_tl }
- %\prop_show:c { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop }
- }
- }
-}
+ }
-\keys_define:nn { uftag / struct }
- {
- attribute .code:n = % A property (attribute, value currently a dictionary)
- {
- \clist_set:No \l_tmpa_clist { #1 }
- \seq_set_from_clist:NN \l_tmpa_seq \l_tmpa_clist
- \tl_set:Nx \l__uftag_attr_value_tl
- {
- \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{[}
+\keys_define:nn { __tag / struct }
+ {
+ attribute-class .code:n =
+ {
+ \clist_set:No \l_tmpa_clist { #1 }
+ \seq_set_from_clist:NN \l_tmpa_seq \l_tmpa_clist
+ \seq_map_inline:Nn \l_tmpa_seq
+ {
+ \prop_if_in:NnF \g__tag_attr_entries_prop {##1}
+ {
+ \msg_error:nnn { tag } { attr-unknown } { ##1 }
+ }
+ \seq_gput_left:Nn\g__tag_attr_class_used_seq { ##1}
+ }
+ \seq_set_map:NNn \l_tmpb_seq \l_tmpa_seq
+ {
+ /##1
+ }
+ \tl_set:Nx \l_tmpa_tl
+ {
+ \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{[}
+ \seq_use:Nn \l_tmpb_seq { \c_space_tl }
+ \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{]}
+ }
+ \int_compare:nT { \seq_count:N \l_tmpa_seq > 0 }
+ {
+ \__tag_prop_gput:cnx
+ { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop }
+ { C }
+ { \l_tmpa_tl }
+ %\prop_show:c { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop }
+ }
}
- \seq_map_inline:Nn \l_tmpa_seq
- {
- \prop_if_in:NnF \g__uftag_attr_entries_prop {##1}
- {
- \msg_error:nnn { uftag } { attr-unknown } { ##1 }
- }
- \prop_if_in:NnF \g__uftag_attr_objnum_prop {##1}
- {
- \__uftag_pdfreserveobjnum:N \l_tmpa_tl
- \__uftag_pdfuseobjnum:Nx \l_tmpa_tl
- {
- \prop_item:Nn\g__uftag_attr_entries_prop {##1}
- }
- \prop_gput:NnV \g__uftag_attr_objnum_prop {##1} {\l_tmpa_tl}
- }
- \tl_put_right:Nx \l__uftag_attr_value_tl
+ }
+
+\keys_define:nn { __tag / struct }
+ {
+ attribute .code:n = % A property (attribute, value currently a dictionary)
{
- \c_space_tl
- \prop_item:Nn \g__uftag_attr_objnum_prop {##1}
- \c_space_tl 0 \c_space_tl R
- }
- % \tl_show:N \l__uftag_attr_value_tl
- }
- \tl_put_right:Nx \l__uftag_attr_value_tl
- {
- \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{]}
- }
- % \tl_show:N \l__uftag_attr_value_tl
- \__uftag_prop_gput:cnx
- { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop }
- { A }
- { \l__uftag_attr_value_tl }
- },
- }
-\endinput
+ \clist_set:No \l_tmpa_clist { #1 }
+ \seq_set_from_clist:NN \l_tmpa_seq \l_tmpa_clist
+ \tl_set:Nx \l__tag_attr_value_tl
+ {
+ \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{[}%]
+ }
+ \seq_map_inline:Nn \l_tmpa_seq
+ {
+ \prop_if_in:NnF \g__tag_attr_entries_prop {##1}
+ {
+ \msg_error:nnn { tag } { attr-unknown } { ##1 }
+ }
+ \prop_if_in:NnF \g__tag_attr_objref_prop {##1}
+ {%\prop_show:N \g__tag_attr_entries_prop
+ \pdf_object_unnamed_write:nx
+ { dict }
+ {
+ \prop_item:Nn\g__tag_attr_entries_prop {##1}
+ }
+ \prop_gput:Nnx \g__tag_attr_objref_prop {##1} {\pdf_object_ref_last:}
+ }
+ \tl_put_right:Nx \l__tag_attr_value_tl
+ {
+ \c_space_tl
+ \prop_item:Nn \g__tag_attr_objref_prop {##1}
+ }
+ % \tl_show:N \l__tag_attr_value_tl
+ }
+ \tl_put_right:Nx \l__tag_attr_value_tl
+ { %[
+ \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{]}%
+ }
+ % \tl_show:N \l__tag_attr_value_tl
+ \__tag_prop_gput:cnx
+ { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop }
+ { A }
+ { \l__tag_attr_value_tl }
+ },
+ }
+%%
+%%
+%% End of file `tagpdf-attr-code.sty'.