%% %% This is file `ocgtools.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% ocgtools.dtx (with options: `package') %% %% This is a generated file. %% %% Copyright (C) 2010 by Robert Marik %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.2 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 %% %% and version 1.2 or later is part of all distributions of LaTeX version %% 1999/12/01 or later. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{ocgtools} [2010/04/01 v0.5 ocgtools.dtx file] \def\ocgtools@msg{If message does not disappear after a short time, the author either did not compile the \LaTeX{} file three times, or your PDF viewer does not support OCG. Use Adobe Reader!} \def\ocgtextstart{\color{blue}} \def\ocgtextend{} \ifx\definecolor\undefined\RequirePackage{color}\fi \ifx\href\undefined\RequirePackage[pdftex]{hyperref}\fi \definecolor{ocgpaper}{rgb}{1,1,0.2} \definecolor{ocgbg}{rgb}{0,0,0} \RequirePackage{graphicx} \RequirePackage{pifont} \RequirePackage{ocg} \def\ocgclosechar{\ding{56}} \RequirePackage{atbegshi} \RequirePackage[pdftex]{eforms} \newif\if@ocgtools@transparent\@ocgtools@transparentfalse \DeclareOption{transparent}{\@ocgtools@transparenttrue} \newif\if@ocgtools@insertvisible\@ocgtools@insertvisiblefalse \def\ocgtools@initialvisibility{0} \DeclareOption{insertvisible}{\@ocgtools@insertvisibletrue \def\ocgtools@initialvisibility{1}} \newif\ifocg@hide@button\ocg@hide@buttontrue \DeclareOption{nobutton}{\ocg@hide@buttonfalse} \newif\ifocgtools@noocg\ocgtools@noocgfalse \DeclareOption{noocg}{\ocgtools@noocgtrue} \def\ocgtools@progressmsg{\lower \layerVshift\hbox to 0 pt{ %space \textField[\V{OCGtools: processing OCG's ...}\BG{1} \textColor{1 0 0} \textSize{10}]% {ocgtoolsmsg}{6cm}{20pt}\hss}}% \DeclareOption{noprogressmsg}{\let\ocgtools@progressmsg\relax} \newif\if@ocgtools@minimouseover \@ocgtools@minimouseoverfalse \DeclareOption{minimouseover}{\@ocgtools@minimouseovertrue} \newif\if@ocgtools@mouseover \@ocgtools@mouseoverfalse \DeclareOption{mouseover}{\@ocgtools@mouseovertrue \@ocgtools@minimouseovertrue} \newif\if@ocgtools@pageclose \@ocgtools@pageclosetrue \DeclareOption{nopageclose}{\@ocgtools@pageclosefalse} \ProcessOptions \edef\ocgtools@pdfpageattr{ /AA << /O << /S /JavaScript /JS ( try{ var temp = ocgtoolsOCGs.length; \if@ocgtools@pageclose for(var i=0; ocgtoolsOCGs && i> >> } \expandafter\global\expandafter\pdfpageattr\expandafter{\ocgtools@pdfpageattr} \def\ocgtools@transparent{} \if@ocgtools@transparent \RequirePackage{transparent} \def\ocgtools@transparent{\transparent{0.4}} \fi \newif\ifocg@minitext@left \newif\ifocg@minitext@bottom \newcount\ocgtools@layercount \newskip\ocgtools@left@skip \newskip\ocgtools@bottom@skip \newdimen\ocgtools@maxheight \newdimen\ocgtools@maxwidth \newdimen\layerHshift \layerHshift=0pt \newdimen\layerVshift \layerVshift=0pt \ifx\@Rightmargin\undefined\else \layerVshift=3pt \fi \ifx\PDFSCR@Warning\undefined\else \layerVshift=\@Bottommargin \fi \newtoks\ocgtools@layer@toks \ocgtools@layer@toks{} \newbox\ocgtools@box@a \newbox\ocgtools@box@b \newif\ifocg@page@contains@layer \def\ocgtools@one{1} \let\ocgtools@shipoutstart@hook\relax \let\ocgtools@shipoutend@hook\relax \AtBeginShipout{% \setbox\AtBeginShipoutBox=\hbox{% \ocgtools@shipoutstart@hook \hbox to 0 pt{\box\AtBeginShipoutBox\hss}\kern -1in\kern \layerHshift \ocg@page@contains@layerfalse \lower \layerVshift \hbox{\the\ocgtools@layer@toks}% \ifocg@page@contains@layer \vbox to 0 pt{\kern -\paperheight \kern\layerVshift\hbox to 0 pt{\ocgtools@HideBtn\hss}\vss}% \fi \xdef\ocgtools@currpage{\thepage}% \ifx\ocgtools@currpage\ocgtools@one \ocgtools@progressmsg \fi \hss \ocgtools@shipoutend@hook% \kern 1in \kern -\layerHshift% }% } \def\ocgtools@HideBtn{\pushButton[\W{0}\BG{}\S{S}\BC{}\H{N}\F{\FHidden}\A{\JS{ for(var i=0; ocgtoolsOCGs && i> }#2% \if@ocgtools@mouseover \hbox to 0 pt{\hss\pushButton[\W{0}\S{S}\BG{}\BC{}\H{N}% \A{\JS{ var OpenedByMouseEnter#1=false; \ifocg@hide@button this.getField("OcgtoolsBtn.HideButton.main").hidden = false;\fi this.getField("OcgtoolsBtn.HideButton.corner").hidden = false; this.getField("OcgtoolsBtn.HideButton.corner.#1").setFocus(); }} \AA{\AAMouseEnter{\JS{ for(var i=0; ocgtoolsOCGs && i> }#2% \if@ocgtools@minimouseover \hbox to 0 pt{\hss\pushButton[\W{0}\S{S}\BG{}\BC{}\H{N}% \A{\JS{ var OpenedByMouseEnter#1=false; this.getField("OcgtoolsBtn.HideButton.mini.#1").setFocus(); }} \AA{\AAMouseEnter{\JS{for(var i=0; ocgtoolsOCGs && i\wd\ocgtools@box@a \advance \ocgtools@left@skip by -\wd\ocgtools@box@a plus 0 pt minus -\wd\ocgtools@box@a \else \ocgtools@left@skip=0pt\relax \fi \fi \ifocg@minitext@bottom \advance \ocgtools@bottom@skip by -\ht\ocgtools@box@a \fi \hbox to 0 pt{\hbox to \paperwidth{\hskip \ocgtools@left@skip \vbox to 0 pt{\vss \vbox to \paperheight{\vskip 0 pt plus 1 fill \box\ocgtools@box@a\vskip \ocgtools@bottom@skip} }% \hskip 0 pt plus 1 fill}\hss}% \fi } \def\ocgtools@drawpicture#1#2{\vbox to \paperheight{\vbox to 0 pt{{% \ocgtools@transparent\color{ocgbg}% \hrule width \paperwidth height \paperheight}\vss}\vss \hbox to \paperwidth{\hss \setbox\ocgtools@box@a=\hbox{\includegraphics[height=\ocgtools@maxheight]{#1}}% \ifdim\wd\ocgtools@box@a>\ocgtools@maxwidth \includegraphics[width=\ocgtools@maxwidth]{#1}\else \box\ocgtools@box@a \fi \hss}% \vss \hbox to \paperwidth {\hss\ocgtools@HideLayers{#2}}}} \newdimen\ocg@textdimen \long\def\ocgtools@drawtext#1#2#3{\vbox to \paperheight{% \vbox to 0 pt{{\ocgtools@transparent\color{ocgbg}% \hrule width \paperwidth height \paperheight}\vss}\vss\hbox to \paperwidth {\hss \ocg@textdimen=#1 \ifdim\ocg@textdimen=0pt \setbox\ocgtools@box@a=\hbox{\colorbox{ocgpaper}{#2}}% \else \setbox\ocgtools@box@a=\hbox{\colorbox{ocgpaper}% {\vbox{\hsize=#1\relax\rightskip 0 pt plus 1 fil\relax #2}}}% \fi \setbox\ocgtools@box@b\hbox{\resizebox{!}{\ocgtools@maxheight}{\copy\ocgtools@box@a}}% \ifdim\wd\ocgtools@box@b>\ocgtools@maxwidth \resizebox{\ocgtools@maxwidth}{!}{\box\ocgtools@box@a} \else \box\ocgtools@box@b \fi \hss}% \vss \hbox to \paperwidth {\hss\ocgtools@HideLayers{#3}}}} \def\ocg@empty{} \newcommand\ocgtools@drawminitext[3]{\ocg@textdimen=#1 \ifdim\ocg@textdimen=0pt \setbox\ocgtools@box@a=\hbox{\colorbox{ocgpaper}{#2\ }}% \else \setbox\ocgtools@box@a=\hbox{\colorbox{ocgpaper}% {\vbox{\hsize=#1\relax\rightskip 0 pt plus 1 fil\relax #2}}}% \fi \def\temp{#3}% \ifx\temp\ocg@empty \box\ocgtools@box@a \else \hbox{\copy\ocgtools@box@a\raise\ht\ocgtools@box@a \vbox to 0 pt{\hbox to 0 pt{\hss \ocgtools@HideMiniLayer{#3}}\vss}}% \fi } \ifocgtools@noocg \renewcommand\ocgpicture[2][]{\leavevmode\includegraphics[#1]{#2}} \renewcommand\ocgtext[3][0pt]{\leavevmode #2} \long\def\do@ocg@minitext#1#2#3#4{\leavevmode #2}% \renewcommand\ocgtoolsplacepicture[3]{} \renewcommand\ocgtoolsplacetext[3]{} \renewcommand\ocgtoolsplaceminitext[7]{} \fi \endinput %% %% End of file `ocgtools.sty'.