diff options
author | Karl Berry <karl@freefriends.org> | 2007-05-05 00:03:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-05-05 00:03:01 +0000 |
commit | 4bb2d3efea659bd0e027df4d2cfa3da1af1be95a (patch) | |
tree | 7db286cf8738cc40364618dfdf0eee0b86fef1c7 /Master/texmf-dist/tex/latex/movie15 | |
parent | 6c05833cefc91774505f6825b70ee56d8c733cb6 (diff) |
movie15 update (3may07)
git-svn-id: svn://tug.org/texlive/trunk@4237 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/movie15')
-rw-r--r-- | Master/texmf-dist/tex/latex/movie15/movie15.sty | 196 |
1 files changed, 117 insertions, 79 deletions
diff --git a/Master/texmf-dist/tex/latex/movie15/movie15.sty b/Master/texmf-dist/tex/latex/movie15/movie15.sty index ecee01305cd..b64ca5043be 100644 --- a/Master/texmf-dist/tex/latex/movie15/movie15.sty +++ b/Master/texmf-dist/tex/latex/movie15/movie15.sty @@ -9,7 +9,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{movie15}[2007/01/17] +\ProvidesPackage{movie15}[2007/05/02] \RequirePackage{keyval} \RequirePackage{ifthen} \RequirePackage{ifpdf} @@ -42,18 +42,24 @@ \DeclareOption*{% \PackageWarning{movie15}{Unknown option \CurrentOption} } + \ProcessOptions*\relax -%correct pdfTeX version? -\ifpdf% - \ifnum\pdftexversion<120% - \PackageError{movie15}{% - pdf(La)TeX version >= 1.20 required for direct PDF output - }{% - Install a more recent version! - }% - \fi% -\fi% +%testing for correct TeX version, pdfmdfivesum file is needed for both, +%pdf _and_ dvi output +\ifx\@undefined\pdfmdfivesum file + \PackageError{movie15}{% + pdfeTeX, version >= 1.30, required + }{% + Install a more recent version! + }% +\fi + +\ifpdf %allows pdftex to directly import Metapost generated Postscript + \ifx\MPtoPDF\@undefined + \InputIfFileExists{supp-pdf}{}{}% + \fi +\fi %for conditionals where \ifthenelse doesn't work \gdef\@MXV@if#1{\csname if#1\endcsname}% @@ -191,6 +197,7 @@ \newboolean{@MXV@linkstop} \newboolean{@MXV@linkclose} \newboolean{@MXV@linkreset} +\newboolean{@MXV@issound} %macro to reset all macros and booleans \def\@MXV@reset{% @@ -203,6 +210,7 @@ \setboolean{@MXV@inline}{true}% \setboolean{@MXV@attachment}{true}% \setboolean{@MXV@externalviewer}{false}% + \setboolean{@MXV@issound}{false}% \setboolean{@MXV@url}{false}% \setboolean{@MXV@boxopt}{false}% \setboolean{@MXV@textoverposter}{true}% @@ -371,6 +379,15 @@ }}}}}}}}}}}}}}}}% } +%sets @MXV@issound boolean +\def\@MXV@@issound#1/#2.{% argument: \@MXV@mime. + \def\@MXV@firstarg{#1}% + \def\@MXV@audio{audio}% + \ifx\@MXV@firstarg\@MXV@audio% + \setboolean{@MXV@issound}{true}% + \fi% +} + %draft box \def\@MXV@draftbox#1#2#3#4{%width height depth filename \edef\@MXV@oldfboxsep{\the\fboxsep}% @@ -604,20 +621,20 @@ }% \ifthenelse{\equal{\@MXV@restype}{image}}{% %embed the same image file only once - \ifthenelse{\equal{\@MXV@getlabelvalue{#1}}{undefined}}{% + \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}{undefined}}{% \immediate\pdfximage {#1}% \xdef\@MXV@resourcetree{% build name tree for embedded resources \@MXV@resourcetree\space (#1) \the\pdflastximage\space 0 R% }% - \@MXV@newlabel{#1}{\the\pdflastximage}% + \@MXV@newlabel{\pdfmdfivesum file {#1}}{\the\pdflastximage}% }{% \xdef\@MXV@resourcetree{% - \@MXV@resourcetree\space (#1) \@MXV@getlabelvalue{#1}\space 0 R% + \@MXV@resourcetree\space (#1) \@MXV@getlabelvalue{\pdfmdfivesum file {#1}}\space 0 R% }% }% }{% %embed the same 3D file only once - \ifthenelse{\equal{\@MXV@getlabelvalue{#1}}{undefined}}{% + \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}{undefined}}{% \pdfobj stream % attr {% /Subtype/\@MXV@restype% @@ -627,10 +644,10 @@ \xdef\@MXV@resourcetree{% \@MXV@resourcetree\space (#1) \the\pdflastobj\space 0 R% }% - \@MXV@newlabel{#1}{\the\pdflastobj}% + \@MXV@newlabel{\pdfmdfivesum file {#1}}{\the\pdflastobj}% }{% \xdef\@MXV@resourcetree{% - \@MXV@resourcetree\space (#1) \@MXV@getlabelvalue{#1}\space 0 R% + \@MXV@resourcetree\space (#1) \@MXV@getlabelvalue{\pdfmdfivesum file {#1}}\space 0 R% }% }% }% @@ -860,28 +877,34 @@ }% \ifthenelse{\equal{\@MXV@restype}{image}}{% %embed the same image file only once - \ifthenelse{\equal{\@MXV@getlabelvalue{#1}}{undefined}}{% + \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}{undefined}}{% %increment counter of embedded resource files \global\advance\@MXV@rescount by 1% %create Image XObject from next raster image \special{ps:% read image resource from file [ /_objdef {resource\the\@MXV@rescount} /NI pdfmark - save gsave newpath clip /showpage {} def /setpagedevice /pop load def - (#1) run 0 0 1 [1 0 0 1 0 0] {} image %empty dummy, in case #1 is not - grestore restore %a valid image file + save gsave + { + /showpage {} def + /setpagedevice /pop load def + newpath clip + (#1) run + } ?pdfmark + 0 0 1 [1 0 0 1 0 0] {} image %empty dummy, in case #1 is not + grestore restore %a valid image file }% \xdef\@MXV@resourcetree{% build name tree for embedded resources \@MXV@resourcetree\space (#1) {resource\the\@MXV@rescount}% }% - \@MXV@newlabel{#1}{resource\the\@MXV@rescount}% + \@MXV@newlabel{\pdfmdfivesum file {#1}}{resource\the\@MXV@rescount}% }{% \xdef\@MXV@resourcetree{% - \@MXV@resourcetree\space (#1) {\@MXV@getlabelvalue{#1}}% + \@MXV@resourcetree\space (#1) {\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}% }% }% }{% %embed the same 3D file only once - \ifthenelse{\equal{\@MXV@getlabelvalue{#1}}{undefined}}{% + \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}{undefined}}{% \global\advance\@MXV@rescount by 1% \special{ps: [ /_objdef {resource\the\@MXV@rescount} /type/stream /OBJ pdfmark @@ -893,10 +916,10 @@ \xdef\@MXV@resourcetree{% \@MXV@resourcetree\space (#1) {resource\the\@MXV@rescount}% }% - \@MXV@newlabel{#1}{resource\the\@MXV@rescount}% + \@MXV@newlabel{\pdfmdfivesum file {#1}}{resource\the\@MXV@rescount}% }{% \xdef\@MXV@resourcetree{% - \@MXV@resourcetree\space (#1) {\@MXV@getlabelvalue{#1}}% + \@MXV@resourcetree\space (#1) {\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}% }% }% }% @@ -1212,7 +1235,7 @@ }catch (e){} } \fi% - e.target.visible=true; + \if@MXV@issound\else e.target.visible=true;\fi% }, onPlay: function (e) {% e.target.settings.privateData.paused=false; @@ -1233,7 +1256,7 @@ e.target.settings.privateData.paused=false; e.target.seek(e.target.settings.startAt); } - e.target.visible=true; + \if@MXV@issound\else e.target.visible=true;\fi% \@MXV@if{#3} e.target.settings.privateData.paused=false; e.target.play(); @@ -1264,7 +1287,7 @@ %embedded file entry `/EF' \if@MXV@inline% %embed the same media file only once - \ifthenelse{\equal{\@MXV@getlabelvalue{#4}}{undefined}}{% + \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#4}}}{undefined}}{% \pdfobj stream % attr {% /Type/EmbeddedFile% @@ -1275,10 +1298,10 @@ \edef\@MXV@efentry{% /EF << /F \the\pdflastobj\space 0 R >>% }% - \@MXV@newlabel{#4}{\the\pdflastobj}% + \@MXV@newlabel{\pdfmdfivesum file {#4}}{\the\pdflastobj}% }{% \edef\@MXV@efentry{% - /EF << /F \@MXV@getlabelvalue{#4}\space 0 R >>% + /EF << /F \@MXV@getlabelvalue{\pdfmdfivesum file {#4}}\space 0 R >>% }% }% \else\def\@MXV@efentry{}\fi% @@ -1560,7 +1583,8 @@ {mediarendition\the\@MXV@includes} <<% /C {mediaclipdata\the\@MXV@includes}% /S/MR% - /SP <</BE<</O 0.0>>>>% %screen parameters: fully transparent + %screen parameters: fully transparent, hidden if audio mime type + /SP <</BE<</O 0.0>>>>% /P <<%Media Play Parameters \@MXV@player% /BE <<%Parameters need only be honored by the player in @@ -1620,7 +1644,7 @@ %embedded file entry `/EF' \if@MXV@inline% %embed the same media file only once - \ifthenelse{\equal{\@MXV@getlabelvalue{#4}}{undefined}}{% + \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#4}}}{undefined}}{% %new stream object \pdfmark{% pdfmark=/OBJ,% @@ -1646,9 +1670,9 @@ }% }% \edef\@MXV@moviestream{fstream\the\@MXV@includes}% - \@MXV@newlabel{#4}{fstream\the\@MXV@includes}% + \@MXV@newlabel{\pdfmdfivesum file {#4}}{fstream\the\@MXV@includes}% }{% - \edef\@MXV@moviestream{\@MXV@getlabelvalue{#4}}% + \edef\@MXV@moviestream{\@MXV@getlabelvalue{\pdfmdfivesum file {#4}}}% }% % put the embedded file entry into file spec object \pdfmark{% @@ -1817,6 +1841,7 @@ \else% \xdef\@MXV@filename{\filename@base.\filename@ext}% \fi% + \expandafter\@MXV@@issound\@MXV@mime.% % %if 3D object is not embedded inline we must use some external player :( \ifthenelse{% @@ -2011,6 +2036,9 @@ \@MXV@labeltoaux{@MXV@\@MXV@label.autoplay}{% \if@MXV@autoplay true\else false\fi}% \@MXV@labeltoaux{@MXV@\@MXV@label.3D}{false}% + \@MXV@labeltoaux{@MXV@\@MXV@label.issound}{% + \if@MXV@issound true\else false\fi}% + % \@MXV@newlabel{@MXV@\@MXV@label.mouse}{% \if@MXV@mouse true\else false\fi}% \@MXV@newlabel{@MXV@\@MXV@label.showUI}{\@MXV@ctrls}% @@ -2023,6 +2051,9 @@ \@MXV@newlabel{@MXV@\@MXV@label.autoplay}{% \if@MXV@autoplay true\else false\fi}% \@MXV@newlabel{@MXV@\@MXV@label.3D}{false}% + \@MXV@newlabel{@MXV@\@MXV@label.issound}{% + \if@MXV@issound true\else false\fi}% + % \fi% % \ifthenelse{\boolean{@MXV@autoplay}\OR\boolean{@MXV@runposter}}{% @@ -2126,7 +2157,7 @@ %drag the player on the current slide (presentation mode) player\@MXV@currplayer.page=this.pageNum; %... and make it visible - player\@MXV@currplayer.visible=true; + \if@MXV@issound\else player\@MXV@currplayer.visible=true;\fi% % %start or resume media which have autoplay option set; %also resume paused media which have autoresume option set @@ -2172,7 +2203,7 @@ \fi% } else{% - throw "isClosed"; + throw 'isClosed'; } } catch(e){% @@ -2357,25 +2388,25 @@ \edef\@MXV@linkjscriptiiid{% try{% %fill hash (annot3D) with refs to Annot3D objects - annot3D["\@MXV@label"]=getAnnots3D(% + annot3D['\@MXV@label']=getAnnots3D(% \@MXV@getlabelvalue{% @MXV@annot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}.page% }-1% )[\@MXV@getlabelvalue{@MXV@\@MXV@@label.3Doncurpage}-1];% - annot3D["\@MXV@label"].activated=true;% + annot3D['\@MXV@label'].activated=true;% }catch(e){% try{% annot3D=new Array;% - annot3D["\@MXV@label"]=getAnnots3D(% + annot3D['\@MXV@label']=getAnnots3D(% \@MXV@getlabelvalue{% @MXV@annot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}.page% }-1% )[\@MXV@getlabelvalue{@MXV@\@MXV@@label.3Doncurpage}-1];% - annot3D["\@MXV@label"].activated=true;% + annot3D['\@MXV@label'].activated=true;% }catch(e){% var spc=String.fromCharCode(32);% - app.alert("3D" + spc + "annotation" + spc + "could" + spc +% - "not" + spc + "be" + spc + "activated!");% + app.alert('3D' + spc + 'annotation' + spc + 'could' + spc +% + 'not' + spc + 'be' + spc + 'activated!');% }% }% }% @@ -2384,7 +2415,7 @@ \@MXV@linkjscriptiiid try{ %JavaScript to print the camera settings of the current view - var camera=annot3D["\@MXV@label"].context3D.scene.cameras.getByIndex(0);% + var camera=annot3D['\@MXV@label'].context3D.scene.cameras.getByIndex(0);% var coo=camera.targetPosition;% var c2c=camera.position.subtract(coo);% var roo=c2c.length;% @@ -2435,7 +2466,7 @@ up.normalize();% %find the camera up-vector up0, that corresponds to zero roll %(Gram-Schmitt orthogonalisation) - var worldup=new annot3D["\@MXV@label"].context3D.Vector3();% + var worldup=new annot3D['\@MXV@label'].context3D.Vector3();% worldup.set(0,0,1);% var out=c2c.scale(-1);% var up0=worldup.subtract(out.scale(out.dot(worldup)));% @@ -2464,28 +2495,28 @@ var settings={% initialize: function(dialog) {% dialog.load({% - "text": res% + 'text': res% });% },% description: {% name: 'Current' + spc + '3D' + spc + 'Camera' + spc + 'Settings',% elements: [% {% - type: "static_text",% + type: 'static_text',% name: 'Add' + spc + 'the' + spc + 'following' + spc + 'line' + spc +% 'to' + spc + 'a' + spc + 'file' + spc + 'of' + spc +% - 'predefined' + spc + 'views.' + spc +% - '(See' + spc + 'option' + spc + "`3Dviews'!)"% + 'predefined' + spc + 'views.' + spc +% + '(See' + spc + 'option' + spc + '3Dviews!)'% },% {% - type: "edit_text",% - item_id: "text",% - alignment: "align_fill",% + type: 'edit_text',% + item_id: 'text',% + alignment: 'align_fill',% readonly: false% },% {% - type: "ok",% - ok_name: "Close"% + type: 'ok',% + ok_name: 'Close'% }% ]% }% @@ -2493,8 +2524,8 @@ app.execDialog(settings);% }catch(e){% var spc=String.fromCharCode(32);% - app.alert("Error" + spc + "while" + spc + "executing" + spc +% - "`3Dgetview':" + spc + e);% + app.alert('Error' + spc + 'while' + spc + 'executing' + spc +% + '3Dgetview:' + spc + e);% }% }% \fi% @@ -2687,13 +2718,13 @@ %aperture angle of the virtual camera var aac=\@MXV@calc;% %list of mesh nodes - var meshes=annot3D["\@MXV@label"].context3D.scene.meshes;% + var meshes=annot3D['\@MXV@label'].context3D.scene.meshes;% %auxiliary vectors - var dir=new annot3D["\@MXV@label"].context3D.Vector3();% - var up=new annot3D["\@MXV@label"].context3D.Vector3();% - var corner=new annot3D["\@MXV@label"].context3D.Vector3();% + var dir=new annot3D['\@MXV@label'].context3D.Vector3();% + var up=new annot3D['\@MXV@label'].context3D.Vector3();% + var corner=new annot3D['\@MXV@label'].context3D.Vector3();% %auxiliary 4x4 matrix - var bbox4x4=new annot3D["\@MXV@label"].context3D.Matrix4x4();% + var bbox4x4=new annot3D['\@MXV@label'].context3D.Matrix4x4();% %iterate over all mesh nodes in the scene for(i=0;i<meshes.count;i++){% var mesh=meshes.getByIndex(i);% @@ -2704,7 +2735,7 @@ %build local to world transformation matrix by recursively %multiplying the parent's transf. matrix on the left var parent=mesh.parent;% - while(parent.constructor.name!='Scene'){% + while(parent.transform){% trans=parent.transform.transpose.multiply(trans);% parent=parent.parent;% }% @@ -2763,7 +2794,7 @@ %compute the smallest enclosing bounding sphere mb.build();% %bounding sphere centre - var coo=new annot3D["\@MXV@label"].context3D.Vector3();% + var coo=new annot3D['\@MXV@label'].context3D.Vector3();% coo.set((mb.center())[0], (mb.center())[1], (mb.center())[2]);% %radius of orbit var roo=mb.radius()/ Math.sin(aac * Math.PI/ 360.);% @@ -2793,28 +2824,28 @@ var settings={% initialize: function(dialog){% dialog.load({% - "text": res% + 'text': res% });% },% description: {% name: '3D' + spc + 'Camera' + spc + 'Settings',% elements: [% {% - type: "static_text",% + type: 'static_text',% name: 'Copy' + spc + 'and' + spc + 'paste' + spc +% 'the' + spc + 'following' + spc + 'to' + spc +% 'the' + spc + 'option' + spc + 'list' + spc +% 'of' + spc + spc + '\string\\\string\\includemovie!'% },% {% - type: "edit_text",% - item_id: "text",% - alignment: "align_fill",% + type: 'edit_text',% + item_id: 'text',% + alignment: 'align_fill',% readonly: false% },% {% - type: "ok",% - ok_name: "Close"% + type: 'ok',% + ok_name: 'Close'% }% ]% }% @@ -2822,21 +2853,21 @@ app.execDialog(settings);% }catch(e){% var spc=String.fromCharCode(32);% - app.alert("Error" + spc + "while" + spc + "executing" + spc +% - "`3Dcalculate':" + spc + e);% + app.alert('Error' + spc + 'while' + spc + 'executing' + spc +% + '3Dcalculate:' + spc + e);% }% }% \fi% %create stream from user provided JavaScript file \ifx\@MXV@jscriptiiidfile\@empty\else% \ifthenelse{% create only once - \equal{\@MXV@getlabelvalue{\@MXV@jscriptiiidfile}}{undefined}% + \equal{\@MXV@getlabelvalue{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}}{undefined}% }{% \ifpdf% \pdfobj stream file {\@MXV@jscriptiiidfile}% \pdfrefobj\pdflastobj% \edef\@MXV@userjscriptiiidstream{\the\pdflastobj\space 0 R}% - \@MXV@newlabel{\@MXV@jscriptiiidfile}{\the\pdflastobj}% + \@MXV@newlabel{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}{\the\pdflastobj}% \else% \pdfmark{% pdfmark=/OBJ,% @@ -2855,17 +2886,17 @@ \edef\@MXV@userjscriptiiidstream{% {linkuserjscriptiiid\the\@MXV@links}% }% - \@MXV@newlabel{\@MXV@jscriptiiidfile}% + \@MXV@newlabel{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}% {linkuserjscriptiiid\the\@MXV@links}% \fi% }{% \ifpdf% \edef\@MXV@userjscriptiiidstream{% - \@MXV@getlabelvalue{\@MXV@jscriptiiidfile}\space 0 R% + \@MXV@getlabelvalue{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}\space 0 R% }% \else% \edef\@MXV@userjscriptiiidstream{% - {\@MXV@getlabelvalue{\@MXV@jscriptiiidfile}}% + {\@MXV@getlabelvalue{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}}% }% \fi% }% @@ -2904,6 +2935,13 @@ %get the player ID \edef\@MXV@currplayer{\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}}% % + %see whether a sound inclusion is being referenced + \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.issound}}{true}}{% + \setboolean{@MXV@issound}{true}% + }{% + \setboolean{@MXV@issound}{false}% + }% + % %create /OP and /JS entries \if@MXV@linkplay% \edef\@MXV@operation{% @@ -2940,7 +2978,7 @@ /OP 3% /JS (% try{% - player\@MXV@currplayer.visible=true; + \if@MXV@issound\else player\@MXV@currplayer.visible=true;\fi% if(!player\@MXV@currplayer.isPlaying){% player\@MXV@currplayer.settings.privateData.paused=false; player\@MXV@currplayer.play(); @@ -3015,7 +3053,7 @@ /OP 2% /JS (% try{% - player\@MXV@currplayer.visible=true; + \if@MXV@issound\else player\@MXV@currplayer.visible=true;\fi% if(!player\@MXV@currplayer.isPlaying){% player\@MXV@currplayer.settings.privateData.paused=false; player\@MXV@currplayer.play(); |