diff options
author | Karl Berry <karl@freefriends.org> | 2014-02-17 22:15:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-02-17 22:15:11 +0000 |
commit | c8ed9f53a6a902409b383e37e4018be76fd5c4f7 (patch) | |
tree | 3028cda50aaaff7ec49e2636e31f306d281a7aa9 /Master/texmf-dist/tex/latex/media9 | |
parent | cb14b66aaec03fd9a0fce4e5b3f6d4c9dccb7f3a (diff) |
media9 (16feb14)
git-svn-id: svn://tug.org/texlive/trunk@32992 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/media9')
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/media9.sty | 130 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/players/APlayer.swf | bin | 345873 -> 345957 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/players/VPlayer.swf | bin | 502381 -> 502357 bytes |
3 files changed, 104 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty index 0f92922e10b..6acf9ac4bce 100644 --- a/Master/texmf-dist/tex/latex/media9/media9.sty +++ b/Master/texmf-dist/tex/latex/media9/media9.sty @@ -26,7 +26,7 @@ % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in -% http://www.latex-project.org/lppl.txt +% http://mirrors.ctan.org/help/Catalogue/licenses.lppl.html % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. % @@ -42,8 +42,8 @@ \RequirePackage{atbegshi} \RequirePackage{tikz} -\def\g@mix@date@tl{2014/02/06} -\def\g@mix@version@tl{0.39} +\def\g@mix@date@tl{2014/02/17} +\def\g@mix@version@tl{0.40} \def\g@mix@liiikerneldate{2013/07/28} \def\g@mix@liiipkgdate{2013/07/28} @@ -468,22 +468,60 @@ } \group_end: -%takes Field object refs -\tl_if_exist:cF{@anim@fields}{\tl_gset:cn{@anim@fields}{}} -%macro for adding AcroForm entry to PDF Catalog -\cs_new:Nn\mix_insert_acroform:{ + +%macros for adding AcroForm and OCProperties dicts to PDF Catalog +\tl_if_exist:cF{@anim@fields}{\tl_gset:cn{@anim@fields}{}}%takes Field object refs +\cs_new:Nn\mix_insert_acroform:{ %AcroForm dict \tl_if_exist:cF{Acro@Form@added}{ \mix_pdfobj:nnn{}{array}{} \tl_gset:Nx\g_mix_fieldsarray_tl{\g_mix_pdflastobj_tl} \mix_pdfcatalog:n{ /AcroForm~<</Fields~\g_mix_fieldsarray_tl/NeedAppearances~true>>} - \AtEndDocument{% + \AtEndDocument{ \mix_pdfobj:nnn{\g_mix_fieldsarray_tl}{array}{\@anim@fields} } \tl_gset:cn{Acro@Form@added}{} } } +\tl_if_exist:cF{@anim@ocgs}{\tl_gset:cn{@anim@ocgs}{}} %takes ocg object refs +\tl_if_exist:cF{@anim@offocgs}{\tl_gset:cn{@anim@offocgs}{}} +\cs_new:Nn\mix_insert_ocprops:{%OCProperties dict + \tl_if_exist:cF{oc@props@added}{ + \mix_pdfobj:nnn{}{array}{} + \tl_gset:Nx\g_mix_ocgarray_tl{\g_mix_pdflastobj_tl} + \mix_pdfobj:nnn{}{array}{} + \tl_gset:Nx\g_mix_offocgarray_tl{\g_mix_pdflastobj_tl} + \mix_pdfcatalog:n{ + /OCProperties~<< + /OCGs~\g_mix_ocgarray_tl + /D~<< + /BaseState/ON~/OFF~\g_mix_offocgarray_tl + >> + >> + } + \AtEndDocument{ + \mix_pdfobj:nnn{\g_mix_ocgarray_tl}{array}{\@anim@ocgs} + \mix_pdfobj:nnn{\g_mix_offocgarray_tl}{array}{\@anim@offocgs} + } + \tl_gset:cn{oc@props@added}{} + } +} +\cs_new:Nn\mix_insert_btnocg:{%OCG for play button + \tl_if_exist:NF\g_mix_btnocg_tl{ + \mix_pdfobj:nnn{}{dict}{/Type/OCG/Name~(MediaPlayButton) + /Usage<< + /Print<</PrintState/OFF>> + /Export<</ExportState/OFF>> + >> + } + \tl_gput_right:Nx\@anim@ocgs{\space\g_mix_pdflastobj_tl} + \tl_gput_right:Nx\@anim@offocgs{\space\g_mix_pdflastobj_tl} + \tl_gset:Nx\g_mix_btnocg_tl{\g_mix_pdflastobj_tl} + } + \mix_pdfresources:n{/Properties<</OC@rm@play\space\g_mix_btnocg_tl>>} +} + %commands for creating PDF objects, annots etc. \bool_if:NTF\g_mix_pdfoutput_bool{ %helper func to remove `0 R' part from pdf obj reference @@ -548,6 +586,14 @@ } \cs_new:Nn\mix_pdfcatalog:n{\pdfcatalog{#1}} + \cs_new:Nn\mix_pdfresources:n{ + \group_begin: + \tl_set:Nx\l_mix_temp_tl{\group_end: + \global\pdfpageresources{\the\pdfpageresources #1} + }\l_mix_temp_tl + } + \cs_new:Nn\mix_pdfbdc:{\pdfliteral{/OC/OC@rm@play~BDC}} + \cs_new:Nn\mix_pdfemc:{\pdfliteral{EMC}} }{ \int_new:N\g_mix_obj_int % object ID \bool_if:NTF\g_mix_dvipdfmx_bool{ %dvipdfmx/XeTeX @@ -630,6 +676,9 @@ } \cs_new:Nn\mix_pdfcatalog:n{\special{pdf:put~@catalog~<<#1>>}} + \cs_new:Nn\mix_pdfresources:n{\special{pdf:put~@resources~<<#1>>}} + \cs_new:Nn\mix_pdfbdc:{\special{pdf:~content~/OC/OC@rm@play~BDC}} + \cs_new:Nn\mix_pdfemc:{\special{pdf:~content~EMC}} }{ % dvips \bool_new:N\g_mix_powerdot_bool %to cope with some powerdot oddity @@ -903,6 +952,10 @@ \cs_new:Nn\mix_pdfcatalog:n{ \special{ps:~mark~{Catalog}~<<#1>>~/PUT~pdfmark} } + + \cs_new:Nn\mix_pdfresources:n{} %no-op + \cs_new:Nn\mix_pdfbdc:{\special{ps:~mark~/OC~\g_mix_btnocg_tl~/BDC~pdfmark}} + \cs_new:Nn\mix_pdfemc:{\special{ps:~mark~/EMC~pdfmark}} } } @@ -1394,25 +1447,39 @@ \mix_keytoaux_now:nn{ann@\g_mix_usrlabel_tl}{\g_mix_pdflastann_tl} \mix_keytoaux_shipout:nn{page@\g_mix_usrlabel_tl}{ \noexpand\the\g@mix@page@int} - \mix_pdfobj:nnn{}{dict}{ - /S/JavaScript/JS~( - if(typeof(annotRM)=='undefined'){annotRM=new~Array();} - if(typeof(annotRM['\g_mix_label_tl'])=='undefined'){ - annotRM['\g_mix_label_tl']= - this.getAnnotRichMedia(this.pageNum,'\g_mix_label_tl'); + } + \mix_pdfobj:nnn{}{dict}{ + /S/JavaScript/JS~( + try{ + var~ocgAll=this.getOCGs(this.pageNum); + for(var~i=0;i<ocgAll.length;i++){ + if( + ocgAll[i].name=='MediaPlayButton'&&( + app.viewerType=='Reader'|| + app.viewerType=='Exchange'|| + app.viewerType=='Exchange-Pro' + )&&app.viewerVersion>=9 + )ocgAll[i].state=true; } - ) - } - \mix_pdfannot:nnnn{0pt}{0pt}{0pt}{ - /Subtype/Widget - /FT/Btn/Ff~65537 - /BS~<</W~0>> - /T~(fd@\g_mix_label_tl) - /AA~<</PO~\g_mix_pdflastobj_tl~/PV~\g_mix_pdflastobj_tl>> - } - \tl_gput_right:Nx\@anim@fields{\g_mix_pdflastann_tl\space} - \mix_insert_acroform: + \tl_if_empty:NF\g_mix_usrlabel_tl{ + if(typeof(annotRM)=='undefined'){annotRM=new~Array();} + if(typeof(annotRM['\g_mix_label_tl'])=='undefined'){ + annotRM['\g_mix_label_tl']= + this.getAnnotRichMedia(this.pageNum,'\g_mix_label_tl'); + } + } + }catch(e){} + ) } + \mix_pdfannot:nnnn{0pt}{0pt}{0pt}{ + /Subtype/Widget + /FT/Btn/Ff~65537 + /BS~<</W~0>> + /T~(fd@\g_mix_label_tl) + /AA~<</PO~\g_mix_pdflastobj_tl~/PV~\g_mix_pdflastobj_tl>> + } + \tl_gput_right:Nx\@anim@fields{\space\g_mix_pdflastann_tl\space} + \mix_insert_acroform: \hbox_overlap_right:n{ \box_move_down:nn{\l_mix_dp_tl-\box_dp:N\l_mix_poster_box}{ \box_use:N\l_mix_poster_box @@ -1420,6 +1487,8 @@ } \bool_if:NTF\g_mix_usrpbtn_bool{ %scale and insert play button overlay + \mix_insert_btnocg: %create OCG + \mix_insert_ocprops: \hbox_set:Nn\l_mix_pbtn_box{\g_mix_pbtn_tl} \dim_compare:nTF{\l_mix_tt_tl>\l_mix_wd_tl}{ \box_resize_to_wd:Nn\l_mix_pbtn_box{\l_mix_wd_tl} @@ -1430,7 +1499,11 @@ \hbox_to_wd:nn{\l_mix_wd_tl}{ \hss \vbox_to_ht:nn{\l_mix_tt_tl}{ - \vss\box_use:N\l_mix_pbtn_box\vss + \vss + \mix_pdfbdc: + \box_use:N\l_mix_pbtn_box + \mix_pdfemc: + \vss } \hss } @@ -2313,6 +2386,9 @@ draft .code:n = {}, final .code:n = {}, + tooltip .tl_gset_x:N = \g_mix_tooltip_tl, + tooltip .value_required:, + overface .code:n = { \hbox_set:Nn\l_mix_poster_box{#1} \mix_pdfxform:n{\l_mix_poster_box} @@ -2492,6 +2568,7 @@ \tl_gclear:N\g_mix_overbtn_tl \tl_gclear:N\g_mix_downbtn_tl \tl_gclear:N\g_mix_btnactions_tl + \tl_gclear:N\g_mix_tooltip_tl %process options \bool_gset_eq:NN\g_mix_btndraft_bool\g_mix_pkgdraft_bool \mix_uribegin: %treat URI characters correctly @@ -2510,6 +2587,7 @@ \mix_pdfannot:nnnn{\width}{\height}{\depth}{ /Subtype/Widget /T~(mbtn@\int_use:N\g_mix_mbtncnt_int) + \tl_if_empty:NF\g_mix_tooltip_tl{/TU~(\g_mix_tooltip_tl)} /FT/Btn/Ff~65536 /H/P /MK~<< diff --git a/Master/texmf-dist/tex/latex/media9/players/APlayer.swf b/Master/texmf-dist/tex/latex/media9/players/APlayer.swf Binary files differindex 2926ce52bb5..c2dfb45b19f 100644 --- a/Master/texmf-dist/tex/latex/media9/players/APlayer.swf +++ b/Master/texmf-dist/tex/latex/media9/players/APlayer.swf diff --git a/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf b/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf Binary files differindex 3dd82141c77..2801daea750 100644 --- a/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf +++ b/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf |