summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/media9
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-08-14 23:28:44 +0000
committerKarl Berry <karl@freefriends.org>2012-08-14 23:28:44 +0000
commit4434165a72f0b014b89cb12bcfdc38307a59352e (patch)
treeca6f715d2725a5a4a59b16e3f04147471fdd96aa /Master/texmf-dist/tex/latex/media9
parentc33dd0f6eb3ee533df663d363845fc7d22578ba6 (diff)
media9 (14aug12)
git-svn-id: svn://tug.org/texlive/trunk@27407 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/media9')
-rw-r--r--Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js60
-rw-r--r--Master/texmf-dist/tex/latex/media9/media9.sty129
2 files changed, 118 insertions, 71 deletions
diff --git a/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js b/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js
index b6c82a22876..a987b5ed08c 100644
--- a/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js
+++ b/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js
@@ -4,7 +4,7 @@
//
// 3Dmenu.js
//
-// version 20120301
+// version 20120813
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -311,20 +311,14 @@ function calc3Dopts () {
c2c.set(camera.position);
c2c.subtractInPlace(camera.targetPosition);
c2c.normalize();
- var x=(Math.abs(c2c.x) < 1e-12 ? 0 : c2c.x);
- var y=(Math.abs(c2c.y) < 1e-12 ? 0 : c2c.y);
- var z=(Math.abs(c2c.z) < 1e-12 ? 0 : c2c.z);
- if(!(x==0 && y==-1 && z==0))
- res+=host.util.printf('\n3Dc2c=%s %s %s,', x, y, z);
+ if(!(c2c.x==0 && c2c.y==-1 && c2c.z==0))
+ res+=host.util.printf('\n3Dc2c=%s %s %s,', c2c.x, c2c.y, c2c.z);
//
//new camera settings
//
//bounding sphere centre --> new camera target
var coo=new Vector3();
coo.set((mb.center())[0], (mb.center())[1], (mb.center())[2]);
- coo.x = (Math.abs(coo.x) < 1e-12 ? 0 : coo.x);
- coo.y = (Math.abs(coo.y) < 1e-12 ? 0 : coo.y);
- coo.z = (Math.abs(coo.z) < 1e-12 ? 0 : coo.z);
if(coo.length)
res+=host.util.printf('\n3Dcoo=%s %s %s,', coo.x, coo.y, coo.z);
//radius of orbit
@@ -422,17 +416,11 @@ function get3Dview () {
var roo=c2c.length;
c2c.normalize();
var res='VIEW%=insert optional name here\n';
- var x = (Math.abs(coo.x) < 1e-12 ? 0 : coo.x);
- var y = (Math.abs(coo.y) < 1e-12 ? 0 : coo.y);
- var z = (Math.abs(coo.z) < 1e-12 ? 0 : coo.z);
- if(!(x==0 && y==0 && z==0))
+ if(!(coo.x==0 && coo.y==0 && coo.z==0))
res+=host.util.printf(' COO=%s %s %s\n', coo.x, coo.y, coo.z);
- x = (Math.abs(c2c.x) < 1e-12 ? 0 : c2c.x);
- y = (Math.abs(c2c.y) < 1e-12 ? 0 : c2c.y);
- z = (Math.abs(c2c.z) < 1e-12 ? 0 : c2c.z);
- if(!(x==0 && y==-1 && z==0))
- res+=host.util.printf(' C2C=%s %s %s\n', x, y, z);
- if(roo > 0.11e-17)
+ if(!(c2c.x==0 && c2c.y==-1 && c2c.z==0))
+ res+=host.util.printf(' C2C=%s %s %s\n', c2c.x, c2c.y, c2c.z);
+ if(roo > 1e-9)
res+=host.util.printf(' ROO=%s\n', roo);
var roll = camera.roll*180/Math.PI;
if(host.util.printf('%.4f', roll)!=0)
@@ -576,18 +564,12 @@ function get3Dview () {
var uvec=mesh.transform.transformDirection(new Vector3(0,1,0));
var vvec=mesh.transform.transformDirection(new Vector3(0,0,1));
respart+=' TRANSFORM='
- +(Math.abs(lvec.x) < 1e-12 ? 0 : lvec.x)+' '
- +(Math.abs(lvec.y) < 1e-12 ? 0 : lvec.y)+' '
- +(Math.abs(lvec.z) < 1e-12 ? 0 : lvec.z)+' '
- +(Math.abs(uvec.x) < 1e-12 ? 0 : uvec.x)+' '
- +(Math.abs(uvec.y) < 1e-12 ? 0 : uvec.y)+' '
- +(Math.abs(uvec.z) < 1e-12 ? 0 : uvec.z)+' '
- +(Math.abs(vvec.x) < 1e-12 ? 0 : vvec.x)+' '
- +(Math.abs(vvec.y) < 1e-12 ? 0 : vvec.y)+' '
- +(Math.abs(vvec.z) < 1e-12 ? 0 : vvec.z)+' '
- +(Math.abs(mesh.transform.translation.x) < 1e-12 ? 0 : mesh.transform.translation.x)+' '
- +(Math.abs(mesh.transform.translation.y) < 1e-12 ? 0 : mesh.transform.translation.y)+' '
- +(Math.abs(mesh.transform.translation.z) < 1e-12 ? 0 : mesh.transform.translation.z)+'\n';
+ +lvec.x+' '+lvec.y+' '+lvec.z+' '
+ +uvec.x+' '+uvec.y+' '+uvec.z+' '
+ +vvec.x+' '+vvec.y+' '+vvec.z+' '
+ +mesh.transform.translation.x+' '
+ +mesh.transform.translation.y+' '
+ +mesh.transform.translation.z+'\n';
defaultvals=false;
}
respart+=' END\n';
@@ -610,16 +592,12 @@ function get3Dview () {
var centre=clip.transform.translation;
var normal=clip.transform.transformDirection(new Vector3(0,0,1));
res+=' CROSSSECT\n';
- var x = (Math.abs(centre.x) < 1e-12 ? 0 : centre.x);
- var y = (Math.abs(centre.y) < 1e-12 ? 0 : centre.y);
- var z = (Math.abs(centre.z) < 1e-12 ? 0 : centre.z);
- if(!(x==0 && y==0 && z==0))
- res+=host.util.printf(' CENTER=%s %s %s\n', x, y, z);
- var x = (Math.abs(normal.x) < 1e-12 ? 0 : normal.x);
- var y = (Math.abs(normal.y) < 1e-12 ? 0 : normal.y);
- var z = (Math.abs(normal.z) < 1e-12 ? 0 : normal.z);
- if(!(x==1 && y==0 && z==0))
- res+=host.util.printf(' NORMAL=%s %s %s\n', x, y, z);
+ if(!(centre.x==0 && centre.y==0 && centre.z==0))
+ res+=host.util.printf(
+ ' CENTER=%s %s %s\n', centre.x, centre.y, centre.z);
+ if(!(normal.x==1 && normal.y==0 && normal.z==0))
+ res+=host.util.printf(
+ ' NORMAL=%s %s %s\n', normal.x, normal.y, normal.z);
res+=' END\n';
}
res+='END\n';
diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty
index f860b19cf1e..8c6096b6285 100644
--- a/Master/texmf-dist/tex/latex/media9/media9.sty
+++ b/Master/texmf-dist/tex/latex/media9/media9.sty
@@ -39,8 +39,12 @@
\RequirePackage{l3keys2e}
\RequirePackage{ifpdf}
-\def\g@mix@date@tl{2012/07/31}
-\def\g@mix@version@tl{0.10}
+\def\g@mix@date@tl{2012/08/14}
+\def\g@mix@version@tl{0.11}
+
+\def\g@mix@liiikerneldate{2012/07/16}
+\def\g@mix@liiipkgdate{2012/07/16}
+
\ProvidesExplPackage{media9}{\g@mix@date@tl}{\g@mix@version@tl}
{acrobat-9/X compatible media}
@@ -61,15 +65,15 @@
}
\tex_endinput:D
}
-\@ifpackagelater{expl3}{2012/07/16}{}{
+\@ifpackagelater{expl3}{\g@mix@liiikerneldate}{}{
\msg_error:nnn{media9}{support~outdated}{l3kernel}
\tex_endinput:D
}
-\@ifpackagelater{xparse}{2012/07/16}{}{
+\@ifpackagelater{xparse}{\g@mix@liiipkgdate}{}{
\msg_error:nnn{media9}{support~outdated}{l3packages}
\tex_endinput:D
}
-\@ifpackagelater{l3keys2e}{2012/07/16}{}{
+\@ifpackagelater{l3keys2e}{\g@mix@liiipkgdate}{}{
\msg_error:nnn{media9}{support~outdated}{l3packages}
\tex_endinput:D
}
@@ -97,6 +101,7 @@
perhaps~it~is~spelled~incorrectly.
}
+\bool_new:N\g_mix_pkgbigfiles_bool
\bool_new:N\g_mix_dvipdfmx_bool
\bool_new:N\g_mix_pkgdraft_bool
\tl_gset:Nn\g_mix_pkgact_tl{/XA}
@@ -117,6 +122,11 @@
dvipdfmx .bool_gset:N = \g_mix_dvipdfmx_bool,
xetex .bool_gset:N = \g_mix_dvipdfmx_bool,
+ bigfiles .choice:,
+ bigfiles / true .code:n = {\bool_gset_true:N\g_mix_pkgbigfiles_bool},
+ bigfiles / false .code:n = {\bool_gset_false:N\g_mix_pkgbigfiles_bool},
+ bigfiles .default:n = {true},
+
draft .choice:,
draft / true .code:n = {\bool_gset_true:N\g_mix_pkgdraft_bool},
draft / false .code:n = {\bool_gset_false:N\g_mix_pkgdraft_bool},
@@ -296,7 +306,7 @@
\tl_gset:Nn\g_mix_opt_coo_tl{0~0~0}
\tl_gset:Nn\g_mix_opt_ctoc_tl{0~-1~0}
\tl_gset:Nn\g_mix_opt_ciiw_tl{}
- \fp_gset:Nn\g_mix_opt_roo_fp{1e-8}
+ \fp_gset:Nn\g_mix_opt_roo_fp{1e-9}
\fp_gset:Nn\g_mix_opt_aac_fp{30}
\fp_gset:Nn\g_mix_opt_oscale_fp{1}
\fp_gset:Nn\g_mix_opt_roll_fp{0}
@@ -318,7 +328,7 @@
\tl_set:Nn\l_mix_ctoc_tl{0~-1~0}
\tl_set:Nn\l_mix_ciiw_tl{}
- \fp_set:Nn\l_mix_roo_fp{1e-8}
+ \fp_set:Nn\l_mix_roo_fp{1e-9}
\fp_set:Nn\l_mix_aac_fp{30}
\fp_set:Nn\l_mix_oscale_fp{1}
\fp_set:Nn\l_mix_roll_fp{0}
@@ -492,6 +502,28 @@
ifelse~
}
}
+ \bool_if:NT\g_mix_pkgbigfiles_bool{
+ \special{!~(./\jobname.m9)~run~}
+ %open auxiliary file \jobname.m9 for writing hex encoded streams
+ %of media files. This file is read and executed during ps2pdf
+ %conversion.
+ \iow_new:N\g_mix_mstreams_stream
+ \iow_open:Nn\g_mix_mstreams_stream{\jobname.m9}
+ \iow_now:Nn\g_mix_mstreams_stream{
+ 1~dict~begin~
+ /o{mark/_objdef}bind~def/O{/type/stream/OBJ~pdfmark}bind~def
+ /m~systemdict/mark~get~def
+ /P{/ASCIIHexDecode~filter/PUT~pdfmark}bind~def
+ /C{/CLOSE~pdfmark}bind~def
+ }
+ }
+ }
+ \bool_if:NT\g_mix_pkgbigfiles_bool{
+ \RequirePackage{atenddvi}
+ \AtEndDvi{
+ \iow_now:Nn\g_mix_mstreams_stream{end}
+ \iow_close:N\g_mix_mstreams_stream
+ }
}
\cs_new:Nn\mix_pdfobj:nnn{
@@ -500,14 +532,23 @@
% #3:content (key-value, file, string); may be empty
\tl_set:Nn\l_mix_usenum_tl{}
\tl_if_blank:oTF{#1}{
- \special{ps:~mark~/_objdef~{mix@obj\int_use:N\g_mix_obj_int}~/type
- \str_case:nnn{#2}{
- {dict}{/dict}
- {array}{/array}
- {stream}{/stream}
- {fstream}{/stream}
- }{}~
- /OBJ~pdfmark~
+ \bool_if:nTF{
+ \g_mix_pkgbigfiles_bool &&
+ \str_if_eq_p:nn{#2}{fstream}
+ }{
+ \iow_now:Nx\g_mix_mstreams_stream{
+ o{mix@obj\int_use:N\g_mix_obj_int}O
+ }
+ }{
+ \special{ps:~mark~/_objdef~{mix@obj\int_use:N\g_mix_obj_int}~/type
+ \str_case:nnn{#2}{
+ {dict}{/dict}
+ {array}{/array}
+ {stream}{/stream}
+ {fstream}{/stream}
+ }{}~
+ /OBJ~pdfmark~
+ }
}
\tl_set:Nx\l_mix_usenum_tl{{mix@obj\int_use:N\g_mix_obj_int}}
\int_gincr:N\g_mix_obj_int
@@ -530,19 +571,32 @@
\bool_while_do:nn{
\int_compare_p:n{\l_mix_offset_tl<\l_mix_fsize_tl}
}{
- \special{ps:~
- mark~
- \l_mix_usenum_tl~
- (\mix_filedump:nnn{\l_mix_offset_tl}{32767}{#3})~
- /ASCIIHexDecode~filter~/PUT~
- pdfmark~
+ \bool_if:NTF\g_mix_pkgbigfiles_bool{
+ \iow_now:Nx\g_mix_mstreams_stream{
+ m\l_mix_usenum_tl
+ (\mix_filedump:nnn{\l_mix_offset_tl}{32767}{#3})P
+ }
+ }{
+ \special{ps:~
+ mark~
+ \l_mix_usenum_tl~
+ (\mix_filedump:nnn{\l_mix_offset_tl}{32767}{#3})~
+ /ASCIIHexDecode~filter~/PUT~
+ pdfmark~
+ }
}
\tl_set:Nx\l_mix_offset_tl{\int_eval:n{\l_mix_offset_tl+32767}}
\message{.}
}
\message{>}
- \special{ps:~
- mark~\l_mix_usenum_tl~/CLOSE~pdfmark~
+ \bool_if:NTF\g_mix_pkgbigfiles_bool{
+ \iow_now:Nx\g_mix_mstreams_stream{
+ m\l_mix_usenum_tl~C
+ }
+ }{
+ \special{ps:~
+ mark~\l_mix_usenum_tl~/CLOSE~pdfmark~
+ }
}
}
}{}
@@ -694,6 +748,7 @@
\cs_new:Nn\mix_embedasset:n{ %#1 file name or url
\filename@parse{#1}
+ \tl_set:Nx\l_mix_base_tl{\filename@base}
\tl_set:Nx\l_mix_ext_tl{\filename@ext}
\tl_replace_all:Nnn\l_mix_ext_tl{A}{a}
\tl_replace_all:Nnn\l_mix_ext_tl{B}{b}
@@ -942,8 +997,19 @@
\bool_set_eq:NN\l_mix_url_bool\g_mix_url_bool
\mix_uribegin:
\mix_embedasset:n{#3}
- \bool_gset:Nn\g_mix_iiid_bool{ %test on 3D file type
+ \bool_if:nTF{
\str_if_eq_p:Vn\l_mix_ext_tl{prc}||\str_if_eq_p:Vn\l_mix_ext_tl{u3d}
+ }{
+ \bool_gset_true:N\g_mix_iiid_bool
+ \tl_gset:Nn\g_mix_mainassetsub_tl{3D}
+ }{
+ \str_case_x:nnn{\l_mix_base_tl}{
+ {APlayer}{\tl_gset:Nn\g_mix_mainassetsub_tl{Sound}}
+ {AudioPlayer}{\tl_gset:Nn\g_mix_mainassetsub_tl{Sound}}
+ {VPlayer}{\tl_gset:Nn\g_mix_mainassetsub_tl{Video}}
+ {VideoPlayer}{\tl_gset:Nn\g_mix_mainassetsub_tl{Video}}
+ {StrobeMediaPlayback}{\tl_gset:Nn\g_mix_mainassetsub_tl{Video}}
+ }{\tl_gset:Nn\g_mix_mainassetsub_tl{Flash}}
}
\tl_gset:Nx\g_mix_mainasset_tl{~\g_mix_lastasset_tl}
\mix_uriend:
@@ -1020,7 +1086,7 @@
}
\mix_pdfobj:nnn{}{dict}{
- /Subtype/\bool_if:NTF\g_mix_iiid_bool{3D}{Flash}
+ /Subtype/\g_mix_mainassetsub_tl
/Asset~\g_mix_mainasset_tl
\bool_if:NF\g_mix_iiid_bool{
/Params~<<
@@ -1031,7 +1097,10 @@
>>
}
}
- \mix_pdfobj:nnn{}{dict}{/Instances~[\g_mix_pdflastobj_tl]}%
+ \mix_pdfobj:nnn{}{dict}{
+ /Subtype/\g_mix_mainassetsub_tl
+ /Instances~[\g_mix_pdflastobj_tl]
+ }%
\mix_pdfobj:nnn{}{dict}{
/Assets~<</Names~[\g_mix_assets_tl]>>
/Configurations~[\g_mix_pdflastobj_tl]
@@ -1476,8 +1545,8 @@
3Droo .code:n = {
\fp_gset:Nn\g_mix_opt_roo_fp{abs(#1)}
- \fp_compare:nNnT\g_mix_opt_roo_fp=\c_zero_fp{
- \fp_set:Nn\g_mix_opt_roo_fp{1e-8}}
+ \fp_compare:nNnT\g_mix_opt_roo_fp<{1e-9}{
+ \fp_gset:Nn\g_mix_opt_roo_fp{1e-9}}
\bool_gset_true:N\g_mix_opt_iiidview_bool
\bool_set_true:N\l_mix_roo_bool
},
@@ -1700,8 +1769,8 @@
{\g_mix_vfile_tl}{\int_use:N\l_mix_lineno_int}{ROO}{a~VIEW}
}
\fp_set:Nn\l_mix_roo_fp{abs(#1)}
- \fp_compare:nNnT\l_mix_roo_fp=\c_zero_fp{
- \fp_set:Nn\l_mix_roo_fp{1e-8}}
+ \fp_compare:nNnT\l_mix_roo_fp<{1e-9}{
+ \fp_set:Nn\l_mix_roo_fp{1e-9}}
\bool_set_true:N\l_mix_roo_bool
},
ROO .value_required:,