[latex3-commits] [git/LaTeX3-latex3-pdfresources] renamedict77: added pageresources to pdfdict (294ea2c)
Ulrike Fischer
fischer at troubleshooting-tex.de
Fri Apr 10 00:50:04 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : renamedict77
Link : https://github.com/latex3/pdfresources/commit/294ea2c087a1fcbab16221762bef2a4fa5a8fd6a
>---------------------------------------------------------------
commit 294ea2c087a1fcbab16221762bef2a4fa5a8fd6a
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Fri Apr 10 00:50:04 2020 +0200
added pageresources to pdfdict
>---------------------------------------------------------------
294ea2c087a1fcbab16221762bef2a4fa5a8fd6a
newpackages/new-transparent.sty | 8 ++--
pdfresources.dtx | 64 ++++++++++++++++++++++--------
testfiles-noxetex/extgstate-patches.pvt | 2 +-
testfiles-noxetex/test-new-transparent.pvt | 2 +-
testfiles/xform.pvt | 2 +-
5 files changed, 54 insertions(+), 24 deletions(-)
diff --git a/newpackages/new-transparent.sty b/newpackages/new-transparent.sty
index baa6a99..31f9efa 100644
--- a/newpackages/new-transparent.sty
+++ b/newpackages/new-transparent.sty
@@ -35,7 +35,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{new-transparent}%
- [2019/08/27 v1.4 Transparency via pdfTeX's color stack (HO)]%
+ [2020/04/10 v1.41 Transparency via pdfTeX's color stack (HO)]%
\RequirePackage{ifpdf}
\ifpdf
\else
@@ -53,7 +53,7 @@
\protected\edef\TRP at pdfpageresources {\pdfvariable pageresources}
\protected\def\TRP at pdfcolorstack {\pdfextension colorstack}
\fi
-\ifcsname pdf_pageresources_gput:nnn\endcsname
+\ifcsname pdfdict_put:nnn\endcsname
\else
\PackageWarningNoLine{new-transparent}{%
Loading aborted, because pdf resource management code not found%
@@ -62,12 +62,12 @@
\fi
\ExplSyntaxOn
-\pdf_pageresources_gput:nnn { ExtGState}{TRP1}{<</ca~1/CA~1>>}
+\pdfdict_put:nnn{Page/Resources/ExtGState}{TRP1}{<</ca~1/CA~1>>}
\cs_new_protected:Npn \__transparent_use:n #1
{
\tl_if_exist:cF { c__transparent_TRP#1_tl }
{
- \pdf_pageresources_gput:nnn { ExtGState}{TRP#1}{<</ca~#1/CA~#1>>}
+ \pdfdict_put:nnn{Page/Resources/ExtGState}{TRP#1}{<</ca~#1/CA~#1>>}
\tl_const:cn { c__transparent_TRP#1_tl }{ /TRP#1~gs }
}
}
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 760ff0e..c103894 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -546,11 +546,16 @@
\@@_dict_if_exist:nTF { #1 }
{
\cs_if_exist:cTF
- { @@_dict_/#1/#2_\@@_dict_get_g:n{#1}put:n }
- { \use:c {@@_dict_/#1/#2_\@@_dict_get_g:n{#1}put:n} {#3} } %special handler
+ { @@_dict_/#1/?_\@@_dict_get_g:n{#1}put:nn } %general, name independant handler
+ { \use:c {@@_dict_/#1/?_\@@_dict_get_g:n{#1}put:n} {#2} {#3} }
{
- \use:c { prop_\@@_dict_get_g:n{#1}put:cnn }
- { \@@_dict_Xname:n { #1 } }{ #2 } { #3 }
+ \cs_if_exist:cTF
+ { @@_dict_/#1/#2_\@@_dict_get_g:n{#1}put:n }
+ { \use:c {@@_dict_/#1/#2_\@@_dict_get_g:n{#1}put:n} {#3} } %special handler
+ {
+ \use:c { prop_\@@_dict_get_g:n{#1}put:cnn }
+ { \@@_dict_Xname:n { #1 } }{ #2 } { #3 }
+ }
}
}
{
@@ -2167,6 +2172,31 @@
% \begin{macrocode}
%
% setter: #1 is the name of the resource
+\@@_dict_gnew:n {Page / Resources / ExtGState}
+\@@_dict_gnew:n {Page / Resources / ColorSpace}
+\@@_dict_gnew:n {Page / Resources / Shading}
+\@@_dict_gnew:n {Page / Resources / Pattern}
+
+\cs_new_protected:cpn { @@_dict_/Page/Resources/ExtGState/?_\@@_dict_get_g:n{#1}put:nn } #1 #2
+ {
+ \@@_backend_PageNResources_gput:nnn {ExtGState} { #1 }{ #2 }
+ }
+
+\cs_new_protected:cpn { @@_dict_/Page/Resources/ColorSpace/?_\@@_dict_get_g:n{#1}put:nn } #1 #2
+ {
+ \@@_backend_PageNResources_gput:nnn {ColorSpace} { #1 }{ #2 }
+ }
+
+\cs_new_protected:cpn { @@_dict_/Page/Resources/Shading/?_\@@_dict_get_g:n{#1}put:nn } #1 #2
+ {
+ \@@_backend_PageNResources_gput:nnn {Shading} { #1 }{ #2 }
+ }
+
+\cs_new_protected:cpn { @@_dict_/Page/Resources/Pattern/?_\@@_dict_get_g:n{#1}put:nn } #1 #2
+ {
+ \@@_backend_PageNResources_gput:nnn {Pattern} { #1 }{ #2 }
+ }
+
\cs_new_protected:Npn \pdf_pageresources_gput:nnn #1 #2 #3
{
\@@_backend_PageNResources_gput:nnn {#1} { #2 }{ #3 }
@@ -3346,13 +3376,13 @@
\tl_new:N \l_@@_name_tmp_tl
\tl_new:N \l_@@_value_tmp_tl
-\cs_generate_variant:Nn \pdf_pageresources_gput:nnn {noo}
-
-\cs_new_protected:Npn \pdf_pageresources_split_gput:nn #1 #2 %#1 resources
- {
- \@@_split_dict_entry_aux:NNw \l_@@_name_tmp_tl \l_@@_value_tmp_tl #2 \q_stop
- \pdf_pageresources_gput:noo {#1}{\l_@@_name_tmp_tl}{\l_@@_value_tmp_tl}
- }
+%\cs_generate_variant:Nn \pdf_pageresources_gput:nnn {noo}
+%
+%\cs_new_protected:Npn \pdf_pageresources_split_gput:nn #1 #2 %#1 resources
+% {
+% \@@_split_dict_entry_aux:NNw \l_@@_name_tmp_tl \l_@@_value_tmp_tl #2 \q_stop
+% \pdf_pageresources_gput:noo {#1}{\l_@@_name_tmp_tl}{\l_@@_value_tmp_tl}
+% }
\cs_new:Npn \@@_patch_pgfextgs:w #1/#2<<#3>>#4\q_stop
{
@@ -3405,24 +3435,24 @@
\@@_backend_object_write:nn
{__spc_extgstate_op_false}
{/Type /ExtGState~/op~false~/OP~false}
- \pdf_pageresources_gput:nnn
- {ExtGState}
+ \pdfdict_put:nnn
+ {Page/Resources/ExtGState}
{SPCko}
{\@@_backend_object_ref:n {__spc_extgstate_op_false}}
\@@_backend_object_new:nn {__spc_extgstate_op_true0}{dict}
\@@_backend_object_write:nn
{__spc_extgstate_op_true0}
{/Type /ExtGState~/op~true~/OP~true~/OPM~0}%
- \pdf_pageresources_gput:nnn
- {ExtGState}
+ \pdfdict_put:nnn
+ {Page/Resources/ExtGState}
{SPCmz}
{\@@_backend_object_ref:n {__spc_extgstate_op_true0}}
\@@_backend_object_new:nn {__spc_extgstate_op_true1}{dict}
\@@_backend_object_write:nn
{__spc_extgstate_op_true1}
{/Type /ExtGState~/op~true~/OP~true~/OPM~1}%
- \pdf_pageresources_gput:nnn
- {ExtGState}
+ \pdfdict_put:nnn
+ {Page/Resources/ExtGState}
{SPCop}
{\@@_backend_object_ref:n {__spc_extgstate_op_true1}}
\def\spc at Pageresources#1{}
diff --git a/testfiles-noxetex/extgstate-patches.pvt b/testfiles-noxetex/extgstate-patches.pvt
index 92e8657..ee04fd1 100644
--- a/testfiles-noxetex/extgstate-patches.pvt
+++ b/testfiles-noxetex/extgstate-patches.pvt
@@ -20,6 +20,6 @@
abc\texttransparent{0.6}{XXXXXXXXXX}
\ExplSyntaxOn
-\pdf_pageresources_gput:nnn {ExtGState}{bearopacity}{<</ca~0.7/CA~0.7>>}
+\pdfdict_put:nnn{Page/Resources/ExtGState}{bearopacity}{<</ca~0.7/CA~0.7>>}
\ExplSyntaxOff
\end{document}
\ No newline at end of file
diff --git a/testfiles-noxetex/test-new-transparent.pvt b/testfiles-noxetex/test-new-transparent.pvt
index a06cdd8..dc9bb3c 100644
--- a/testfiles-noxetex/test-new-transparent.pvt
+++ b/testfiles-noxetex/test-new-transparent.pvt
@@ -10,7 +10,7 @@
\begin{document}
%\START
\ExplSyntaxOn
-\pdf_pageresources_gput:nnn{ExtGState}{duckopacity}{<</ca~0.2/CA~0.2>>}
+\pdfdict_put:nnn{Page/Resources/ExtGState}{duckopacity}{<</ca~0.2/CA~0.2>>}
\ExplSyntaxOff
\texttransparent{0.5}{xxxxxxxxxxx}
\texttransparent{0.3}{xxxxxxxxxxx}
diff --git a/testfiles/xform.pvt b/testfiles/xform.pvt
index 0ea4e1d..c05d95e 100644
--- a/testfiles/xform.pvt
+++ b/testfiles/xform.pvt
@@ -9,7 +9,7 @@ text
\pdf_xform_new:nnn {myxformA}{/yyy~(bla)}{yyyyy}
-\pdf_pageresources_gput:nnn {ExtGState}{bearopacity}{<</ca~0.7/CA~0.7>>}
+\pdfdict_put:nnn{Page/Resources/ExtGState}{bearopacity}{<</ca~0.7/CA~0.7>>}
\pdf_xform_new:nnn {myxform}{/yyy~(bla)}{xxxxxxxxxx}
More information about the latex3-commits
mailing list.