diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/media9.sty | 76 |
1 files changed, 53 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty index 04f15a8f28d..fbddb205561 100644 --- a/Master/texmf-dist/tex/latex/media9/media9.sty +++ b/Master/texmf-dist/tex/latex/media9/media9.sty @@ -41,8 +41,8 @@ \RequirePackage{ifpdf} \RequirePackage{atbegshi} -\def\g@mix@date@tl{2013/03/08} -\def\g@mix@version@tl{0.25} +\def\g@mix@date@tl{2013/03/20} +\def\g@mix@version@tl{0.27} \def\g@mix@liiikerneldate{2012/07/16} \def\g@mix@liiipkgdate{2012/07/16} @@ -104,7 +104,8 @@ \bool_new:N\g_mix_dvipdfmx_bool \bool_new:N\g_mix_pkgdraft_bool \bool_new:N\g_mix_opt_pkgwindowed_bool -\tl_gset:Nx\g_mix_pkgwindowed_tl{defaultxdefault} +\tl_gset:Nx\g_mix_pkgwinsize_tl{defaultxdefault} +\tl_gset:Nx\g_mix_pkgwinpos_tl{cc} \tl_gset:Nn\g_mix_pkgact_tl{/XA} \tl_gset:Nn\g_mix_pkgdeact_tl{/PC} \tl_gset:Nn\g_mix_pkgtransp_tl{false} @@ -119,6 +120,32 @@ \tl_gclear:N\g_mix_pkgopt_ls_tl \tl_gclear:N\g_mix_pkgopt_rm_tl \bool_new:N\g_mix_pkgiiidcalc_bool + +%floating window settings +\group_begin: +\char_set_lccode:nn{`\+}{`\@} +\tl_to_lowercase:n{ + \group_end: + \cs_new:Npn\mix_parse_windowedarg:w#1+#2+#3\q_stop{ + \tl_if_blank:nF{#1}{\tl_gset:Nn\g_mix_winsize_tl{#1}} + \tl_if_blank:nF{#2}{\tl_gset:Nn\g_mix_winpos_tl{#2}} + } + \cs_new:Nn\mix_parse_windowedarg:N{ + \exp_after:wN\mix_parse_windowedarg:w#1++\q_stop + } +} +\cs_new:Npn\mix_parse_winsizearg:w#1x#2\q_stop{ + \str_if_eq:nnTF{#1}{default}{ + \tl_gset:Nx\tl_mix_fltwd{ + \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_wd_tl}}} + \tl_gset:Nx\tl_mix_fltht{ + \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_tt_tl}}} + }{ + \tl_gset:Nn\tl_mix_fltwd{#1} + \tl_gset:Nn\tl_mix_fltht{#2} + } +} + \keys_define:nn{media9}{ dvipdfmx .bool_gset:N = \g_mix_dvipdfmx_bool, xetex .bool_gset:N = \g_mix_dvipdfmx_bool, @@ -161,14 +188,17 @@ passcontext .default:n = {true}, windowed .code:n = { - \str_if_eq_p:nnTF{#1}{false}{ + \str_if_eq:nnTF{#1}{false}{ \bool_gset_false:N\g_mix_opt_pkgwindowed_bool }{ \bool_gset_true:N\g_mix_opt_pkgwindowed_bool - \tl_gset:Nx\g_mix_pkgwindowed_tl{#1} + \tl_set:Nx\l_tmpa_tl{#1} + \tl_remove_all:Nn\l_tmpa_tl{~} + \mix_parse_windowedarg:N\l_tmpa_tl + \tl_gset_eq:NN\g_mix_pkgwinsize_tl\g_mix_winsize_tl + \tl_gset_eq:NN\g_mix_pkgwinpos_tl\g_mix_winpos_tl } }, - windowed .default:n = {defaultxdefault}, %3D specific options 3Dplaytype .choice:, @@ -338,7 +368,8 @@ \tl_gset_eq:NN\g_mix_transp_tl\g_mix_pkgtransp_tl \tl_gset_eq:NN\g_mix_contextclick_tl\g_mix_pkgcontextclick_tl \bool_gset_eq:NN\g_mix_opt_windowed_bool\g_mix_opt_pkgwindowed_bool - \tl_gset_eq:NN\g_mix_windowed_tl\g_mix_pkgwindowed_tl + \tl_gset_eq:NN\g_mix_winsize_tl\g_mix_pkgwinsize_tl + \tl_gset_eq:NN\g_mix_winpos_tl\g_mix_pkgwinpos_tl %3D specific settings \bool_gset_false:N\g_mix_iiid_bool @@ -1207,7 +1238,7 @@ } %determine floating window size \bool_if:NT\g_mix_opt_windowed_bool{ - \exp_after:wN\mix_parse_windowedarg:w\g_mix_windowed_tl\q_stop + \exp_after:wN\mix_parse_winsizearg:w\g_mix_winsize_tl\q_stop } \mix_pdfobj:nnn{}{dict}{ /Activation~<< @@ -1235,7 +1266,17 @@ /Width~<</Default~\tl_mix_fltwd>> /Height~<</Default~\tl_mix_fltht>> /Position~<< - /HAlign/Center/VAlign/Center/HOffset~0/VOffset~0 + /HOffset~0/VOffset~0 + \str_case_x:nnn{\g_mix_winpos_tl}{ + {tl}{/VAlign/Near/HAlign/Near} + {cl}{/VAlign/Center/HAlign/Near} + {bl}{/VAlign/Far/HAlign/Near} + {bc}{/VAlign/Far/HAlign/Center} + {br}{/VAlign/Far/HAlign/Far} + {cr}{/VAlign/Center/HAlign/Far} + {tr}{/VAlign/Near/HAlign/Far} + {tc}{/VAlign/Near/HAlign/Center} + }{/HAlign/Center/VAlign/Center} >> >> }{ @@ -1456,18 +1497,6 @@ } } -\cs_new:Npn\mix_parse_windowedarg:w#1x#2\q_stop{ - \str_if_eq:nnTF{#1}{default}{ - \tl_gset:Nx\tl_mix_fltwd{ - \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_wd_tl}}} - \tl_gset:Nx\tl_mix_fltht{ - \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_tt_tl}}} - }{ - \tl_gset:Nn\tl_mix_fltwd{#1} - \tl_gset:Nn\tl_mix_fltht{#2} - } -} - %document command options \msg_set:nnnn{media9}{unknown~option}{ @@ -1584,10 +1613,11 @@ \bool_gset_false:N\g_mix_opt_windowed_bool }{ \bool_gset_true:N\g_mix_opt_windowed_bool - \tl_gset:Nx\g_mix_windowed_tl{#1} + \tl_set:Nx\l_tmpa_tl{#1} + \tl_remove_all:Nn\l_tmpa_tl{~} + \mix_parse_windowedarg:N\l_tmpa_tl } }, - windowed .default:n = {defaultxdefault}, %3D specific options 3Dplaytype .choice:, |