summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-17 21:36:21 +0000
committerKarl Berry <karl@freefriends.org>2017-03-17 21:36:21 +0000
commite33fc7da87a62f72327720abe39033ef04b6a265 (patch)
tree96bafd8c98df417780309a175da5e9cc194694fe /Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty
parent3e61a137bdc5f0026fd9ea0c19646343410a3faf (diff)
ocgx2 (17may17)
git-svn-id: svn://tug.org/texlive/trunk@43530 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty')
-rw-r--r--Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty28
1 files changed, 27 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty
index 3646351314e..0b43c9e0e9b 100644
--- a/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty
+++ b/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty
@@ -97,7 +97,10 @@
\RequirePackage{atenddvi}
\RequirePackage{pdfbase}
-\ProvidesExplPackage{ocgbase}{2017/03/09}{0.7}
+\def\g@ocgbase@date@tl{2017/03/16}
+\def\g@ocgbase@version@tl{0.8}
+
+\ProvidesExplPackage{ocgbase}{\g@ocgbase@date@tl}{\g@ocgbase@version@tl}
{support package for ocgx2.sty}
\tl_new:N\g_ocgbase_ocgs_tl %takes ocg object refs
@@ -283,6 +286,25 @@
\cs_new_nopar:Nn\ocgbase_oc_bdc:n{\pbs_pdfbdc:nn{/OC}{#1}}
\cs_new_nopar:Nn\ocgbase_oc_emc:{\pbs_pdfemc:}
+%stack of PDF obj references of currently open OCGs
+\seq_new:N\g_ocgbase_ocgstack_seq
+%push OCG to stack
+\cs_new_nopar:Nn\ocgbase_ocgstack_push:n{
+ \seq_gpush:Nx\g_ocgbase_ocgstack_seq{#1}}
+%pop OCG from stack into tl
+\cs_new_nopar:Nn\ocgbase_ocgstack_pop:N{\seq_gpop:NN\g_ocgbase_ocgstack_seq#1}
+%get top OCG on stack, without removing it
+\cs_new_nopar:Nn\ocgbase_ocgstack_top:{
+ \seq_item:Nn\g_ocgbase_ocgstack_seq{c_one}}
+
+%command that inserts /OC <<OCMD with currently open OCGs>> entry;
+%for use within annotation/xobject dicts
+\cs_new_nopar:Nn\ocgbase_insert_oc:{
+ \seq_if_empty:NF\g_ocgbase_ocgstack_seq{
+ /OC~<</Type/OCMD/OCGs~[\seq_use:Nn\g_ocgbase_ocgstack_seq{~}]/P/AllOn>>
+ }
+}
+
%l2e versions
\cs_gset_eq:NN\ocgbase@new@ocg\ocgbase_new_ocg:nnn
\cs_gset_eq:NN\ocgbase@last@ocg\ocgbase_last_ocg:
@@ -292,3 +314,7 @@
\cs_gset_eq:NN\ocgbase@add@ocg@to@radiobtn@grp\ocgbase_add_ocg_to_radiobtn_grp:nnn
\cs_gset_eq:NN\ocgbase@oc@bdc\ocgbase_oc_bdc:n
\cs_gset_eq:NN\ocgbase@oc@emc\ocgbase_oc_emc:
+\cs_gset_eq:NN\ocgbase@insert@oc\ocgbase_insert_oc:
+\cs_gset_eq:NN\ocgbase@ocgstack@top\ocgbase_ocgstack_top:
+\cs_gset_eq:NN\ocgbase@ocgstack@pop\ocgbase_ocgstack_pop:N
+\cs_gset_eq:NN\ocgbase@ocgstack@push\ocgbase_ocgstack_push:n