summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fancytooltips
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-12-18 00:39:11 +0000
committerKarl Berry <karl@freefriends.org>2010-12-18 00:39:11 +0000
commit4a73b1d699271435818be5da6dafd30dfd77f8e4 (patch)
tree259babba8bd9c63550d24196ba2ab70686aac3f1 /Master/texmf-dist/source/latex/fancytooltips
parentf51d0af7ed4d2b504e2bff7402ac9934879e842e (diff)
fancytooltips 1.8 (18dec10)
git-svn-id: svn://tug.org/texlive/trunk@20781 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/fancytooltips')
-rw-r--r--Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx551
1 files changed, 423 insertions, 128 deletions
diff --git a/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx b/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx
index 233df5c5a7b..b8234789e25 100644
--- a/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx
+++ b/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2004-2009 by Robert Marik <marik@mendelu.cz>
+% Copyright (C) 2004-2010 by Robert Marik <marik@mendelu.cz>
% ----------------------------------------------------------
%
% This file may be distributed and/or modified under the
@@ -22,7 +22,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{fancytooltips}
%<*package>
- [2010/04/10 v1.6 fancytooltips.dtx file]
+ [2010/06/10 v1.8 fancytooltips.dtx file]
%</package>
%
%<*driver>
@@ -42,7 +42,7 @@
%</driver>
% \fi
%
-% \CheckSum{695}
+% \CheckSum{1075}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -90,6 +90,11 @@
% this.dirty and app.focusRect. Changed the name of the file with
% tooltips. Added starred version of \texttt{tooltip} command.}
%
+% \changes{v1.7}{2010/05/20}{Added options \texttt{blur} and
+% \texttt{fg}, cleaned some command names}
+%
+% \changes{v1.8}{2010/06/10}{Added hook do insert stuff on each page.}
+%
% \GetFileInfo{fancytooltips.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
@@ -130,16 +135,37 @@
% (works with layers, only |latex| + |dvips| + Adobe Distiller + Adobe
% Acrobat are supported). All these ``similar'' packages allow to
% write the text for he tooltips and the text for the main document in
-% one file. In contrast to this apporach, |fancytooltips| package
+% one file. In contrast to this approach, |fancytooltips| package
% makes use of an external file. However, if you prefer to write both
% tooltips in one file, you can preprocess your file using |preview|
-% package and exteract tooltips automatically, as shown in the
+% package and extract tooltips automatically, as shown in the
% |examples/fancy-preview| directory.
%
% The buttons are created using |eforms.sty| which is a part of
% AcroTeX bundle.
%
% \section{Usage}
+% \subsection{How the package works}
+% We have to prepare external file with content of tooltips first.
+% The pages of this external file are inserted as icons at hidden
+% buttons into the presentation. Whenever we use a command to insert
+% tooltip, the following actions are performed
+% \begin{itemize}\item
+% The current page is covered by invisible transparent button which
+% spans across the whole page (the information about the pages with
+% tooltips is stored in |aux| file and hence we have to run \LaTeX{}
+% \textit{three times}). The button has an associated JavaScript
+% action to close all tooltips (i.e. make itself and other related
+% buttons hidden).
+% \item The button is created in text. This button is transparent,
+% covers the text typeset by \TeX{} into |\hbox| of dimension 0 pt
+% and allows to activate a JavaScript. This JavaScript takes the
+% picture required, puts this picture as icon to the button which
+% covers the corresponding page and makes this button visible.
+% \item Each page has an associated action which closes all tooltips
+% when the page is opened.
+% \end{itemize}
+%
% \subsection{The file with tooltips}
% The file with tooltips is an ordinary pdf file, one tooltip per
% page, tooltips should be in the top right corner at the page, in a
@@ -170,36 +196,66 @@
% (And among others, the |color| or |xcolor| package is probably
% inputted by the package which is used to build the presentation.)
%
-% \DescribeMacro{filename option} To input the tooltips from file
+% \begin{description}\def\iitem#1{\item[#1]}\sloppy\raggedright
+% \iitem{filename} To input the tooltips from file
% \meta{foo.pdf} call the package with |filename| option:
% |\usepackage[filename=foo]{fancytooltips}|.
%
-% \DescribeMacro{movetips option} By default, tooltip appears in the
+% \iitem{movetips} By default, tooltip appears in the
% top right corner of the page (use View--PageLayout-Single Page in
% your Adobe Reader, please). If the option |movetips| is used, then
-% tooltip appears close to the mouse pointer. More preciselly, tooltip
+% tooltip appears close to the mouse pointer. More precisely, tooltip
% appears with left down corner at the mouse position, if there is
% enough place. If not, tooltip appears with right down corner at the
% mouse position. Finally, the tooltip is shifted down to fit the
-% page, if nesessary\footnote{This option works in this way if every
+% page, if necessary\footnote{This option works in this way if every
% page of the file with tooltips has dimensions of the box with
% tooltip. See the \texttt{examples} subdirectory.}.
%
-% \DescribeMacro{mouseover option} If you use |mouseover| option, then
-% tooltip appears if you move the mouse pointer to the active area (no
-% clicking is necessary).
%
-% \DescribeMacro{inactive option} This option makes the package
-% inactive.
+% \iitem{mouseover} If you use |mouseover| option,
+% then tooltip appears if you move the mouse pointer to the active
+% area (no clicking is necessary).
+%
+% \iitem{inactive} This option makes the package
+% inactive.
%
-% \DescribeMacro{active option} This option forces the package active
-% even if |inactive| option is loaded.
+% \iitem{active} This option forces the package
+% active even if |inactive| option is loaded.
%
-% \DescribeMacro{debug option} Prints two alerts reporting success or
-% problems when opening PDF file in Adobe Acrobat (Adobe Reader). Use
-% this option to find possible source of problems. See also the
-% section Troubleshooting \dots in this manual.
+% \iitem{blur} The rest of the page is blurred, when showing
+% tooltip. Use either |\usepackage[blur]{fancytooltips}| or
+% |\usepackage[blur=number]{fancytooltips}|, where |number| is
+% a number between 0 and 1. (Note that we use transparent package
+% and hence this could have an influence on the colors of the
+% document and could make your PDF less portable.) This option is
+% allowed in pdf\LaTeX{} mode only. If this options brakes colors
+% only on the page which include tooltips, you may want to use
+% option |fixcolor| to fix it.
%
+% \iitem{debug} Prints two alerts reporting success or problems when
+% opening PDF file in Adobe Acrobat (Adobe Reader). Use this option
+% to find possible source of problems. See also the section
+% Troubleshooting \dots in this manual.
+%
+% \iitem{noextratext} Do not append any mark at the end of the link
+% which opens tooltips (see help for |\tooltip|).
+%
+% \iitem {fg} The button for displaying pictures is placed on
+% background and the buttons which activate tooltips are placed
+% immediately in the text by default. With |fg| option all these
+% buttons are placed into foreground after the page is completed. We
+% use |\pdfsavepos| command and keep track of the position for
+% buttons in aux file and hence this option works in pdf\LaTeX\ only
+% and the file needs more compilations. This option does not do
+% anything in dvi mode now (despite the fact that pdf\LaTeX\
+% provides the feature also for dvi mode), but this could be changed
+% if someone requests this feature. Use this option for example, if
+% you use buttons and forms in your PDF (like tests produced by
+% Acro\TeX) and the tooltips should be on the top when displayed.
+%
+% \end{description}
+%
% \DescribeMacro{\tooltip} The user can put the tooltip into her or
% his presentation using the command
% \texttt{\string\tooltip}{\marg{stuff}\marg{keyword-or-pagenumber}}
@@ -211,7 +267,7 @@
% \DescribeMacro{\TooltipExtratext} The printed text \meta{stuff} is
% followed by |\TooltipExtratext| command. The default value is small
% blue soap, as you have seen in the second paragraph of this
-% documentation. There is a package option |noextratext| which defines
+% documentation. There is a package |noextratext| which defines
% |\TooltipExtratext| to be empty. \DescribeMacro{noextratext option}
% If \marg{keyword-or-pagenumber} is not recognized as valid keyword
% for tooltips,
@@ -222,14 +278,15 @@
% and the active button dos not cover the text \marg{stuff}, but
% covers the mark produced by |\TooltipExtratext|.
%
-% \DescribeMacro{\tooltipanim} The user can put a series (animation) of
-% tooltips into the presentation by using
-% \texttt{\string\tooltipanim}\marg{stuff}\marg{start}\marg{end}
+% \DescribeMacro{\tooltipanim}\DescribeMacro{\tooltipanim*} The user
+% can put a series (animation) of tooltips into the presentation by
+% using \texttt{\string\tooltipanim}\marg{stuff}\marg{start}\marg{end}
% command, where \meta{start} and \meta{end} are keywords defined by
% |\keytip| command or page numbers. \DescribeMacro{\delayinterval}
% The delay between two frames is |\delayinterval| milliseconds. The
% default value is 200, you can change it by command
-% |\def\delayinterval{100}|.
+% |\def\delayinterval{100}|. There is also starred version which works
+% similarly like |\tooltip*| command.
%
% \DescribeMacro{\FancyHook} Redefines |\ref| and |\eqref| commands to
% work with preview, see the demo files in |example/fancy-preview|
@@ -241,10 +298,21 @@
% for |\TooltipExtratext|.
%
% \subsection{Changes for dvips users}
-% dvips users have to specify option |dvips| in |fancytooltips| package.
-% \DescribeMacro{pages option} They have to use also a |pages| option
-% with the number of pages in the PDF file with tooltips. You have to
-% call the package by
+% Dvips users also have to prepare tooltips into PDF file, not eps as
+% usual. But we have to insert these tooltips in Adobe Acrobat Pro
+% program. If you use Acrobat Pro version 8.1 and later, install the
+% file \texttt{aeb.js} from AcroTeX eDucation bundle as described in
+% the documentation to AcroTeX.\footnote{If you do not install
+% \texttt{aeb.js} properly, you can still create your presentation ,
+% but you have to import fdf file manually, see the section
+% Troubleshooting and known problems.}
+%
+% Since \LaTeX{} is not capable to find the number of pages in
+% external PDF file with tooltips, dvips users have to specify option
+% |dvips| in |fancytooltips| package. \DescribeMacro{pages} You have
+% to use also a |pages| option with the number of pages in the PDF
+% file with tooltips, if you use dvips route. You have to call the
+% package by
% something like this:\\
% |\usepackage[dvips,filename=tooltipy,pages=27]{fancytooltips}|
%
@@ -252,36 +320,46 @@
% produces |filename.ps| and |Tooltipsdljs.fdf| files. Distill the
% |filename.ps| file into |filename.pdf| and open this file by Adobe
% Acrobat Professional -- this imports macros from |Tooltipsdljs.fdf|
-% file. In Acrobat's JavaScript console (open by |Crtl+J|) run (using
+% file. In Acrobat's JavaScript console (open by |Crtl+J|) run (using
% |Ctrl+Enter|) the command |ImportTooltips();| which is defined for
% the document. This command inserts invisible buttons on the first
% page, imports icons (the file with icons specified as
% \meta{filename} parameter when loading fancytooltips must be in
-% working directory) and returns 1. Then save the file under another
-% name.
+% working directory). You should see a message ``\texttt{importing
+% pictures}'' and the command returns 1 when finished. Then
+% \textbf{save the file} (you can use the same name). If the command
+% |ImportTooltips();| fails, you either have not the PDF file with
+% tooltips in current directory, or the PDF file does not contain
+% JavaScripts. In the latter case insert document level JavaScripts
+% manually as described in the next section.
%
% \section{Troubleshooting and known problems}
% The source code is in Mercurial repository at
% \url{http://bitbucket.org/robert.marik/fancytooltips/}. You can also
-% report problems and issues in the forum at this site.
+% report problems and issues in the forum at this site. The code on
+% |bitbucket.org| is considered as development version and repository
+% for older versions. The last stable version is always the version
+% from CTAN.
% \begin{itemize}
% \item
-% The package works only with the last |eforms.sty|, version
-% 2006/10/03 v1.0a. You can download this version from
+% The package works with |eforms.sty| from version
+% 2006/10/03 v1.0a. You can download this or newer version from
% www.arotex.net site.
% \item If the graphics included by |\TooltipExtratext| and
-% |\TooltipRefmark| has colors with custom opacity, Adobe Acrobat
-% Pro sometimes renders the pictures bad. No problems of this type
-% have been observed with Adobe Reader.
+% |\TooltipRefmark| has colors with \textbf{custom opacity}, Adobe
+% Acrobat Pro sometimes renders the pictures bad. No problems of
+% this type have been observed with free Adobe Reader.
% \item For \textbf{dvips} users: In some cases the file
-% |Tooltipsdljs.fdf| is not imported automatically (probably some
-% setting in Adobe Acrobat). In this case you do not see any message
-% even if you use |debug| option. You have troubles of this type if
-% you see in the Javascript console (Ctrl+J) error messages like
-% ``\texttt{aebTrustedFunctions is not defined 3:Page:Open CloseTooltips is
-% not defined 1:Page:Open}''. In this case you have to import the
-% file |Tooltipsdljs.fdf| manually from menu ``Form''. Then go to
-% the JavaScript console and run |ImportToltips();| command.
+% |Tooltipsdljs.fdf| is \textbf{not imported automatically}
+% (probably some setting in Adobe Acrobat or new versions of
+% |eforms.sty| and |insdljs.sty|). In this case you do not see any
+% message when using |debug| option. You have troubles of this type
+% if you see in the Javascript console (Ctrl+J) error messages like
+% ``\texttt{aebTrustedFunctions is not defined 3:Page:Open
+% CloseTooltips is not defined 1:Page:Open}''. In this case you
+% have to import the file |Tooltipsdljs.fdf| \textbf{manually from
+% ``Form'' menu} in Adobe Acrobat Pro. Then go to the JavaScript
+% console and run |ImportTooltips();| command.
% \end{itemize}
%
% Follow the points below if you want to find the source of your
@@ -297,7 +375,7 @@
% properly).
% \item Both messages should report success for pdflatex users. For
% dvips users one of the message should report error and if you
-% run |ImportToltips();| command in Javascript console, you should
+% run |ImportTooltips();| command in Javascript console, you should
% see a message in Javascript console which confirms that the
% pictures from external PDF file have been imported. If you save
% the PDF file and open again, both messages should report
@@ -311,25 +389,24 @@
% \section{Implementation}
% \begin{macrocode}
%<*package>
-\RequirePackage{everyshi}
\RequirePackage{graphicx}
\RequirePackage{xkeyval}
-\RequirePackage{eso-pic}
+\RequirePackage{atbegshi}
-\newif\ifcreatetips\createtipsfalse
-\DeclareOptionX{createtips}{\createtipstrue}
+\newif\if@fancytooltips@createtips\@fancytooltips@createtipsfalse
+\DeclareOptionX{createtips}{\@fancytooltips@createtipstrue}
\newif\ifTooltip@usepdftex\Tooltip@usepdftextrue
\DeclareOptionX{dvips}{\Tooltip@usepdftexfalse}
-\newif\ifextratext\extratexttrue
-\DeclareOptionX{noextratext}{\extratextfalse}
+\newif\if@fancytooltips@extratext\@fancytooltips@extratexttrue
+\DeclareOptionX{noextratext}{\@fancytooltips@extratextfalse}
-\newif\ifmovetips\movetipsfalse
-\DeclareOptionX{movetips}{\movetipstrue}
+\newif\if@fancytooltips@movetips\@fancytooltips@movetipsfalse
+\DeclareOptionX{movetips}{\@fancytooltips@movetipstrue}
-\newif\ifmouseover\mouseoverfalse
-\DeclareOptionX{mouseover}{\mouseovertrue}
+\newif\if@fancytooltips@mouseover\@fancytooltips@mouseoverfalse
+\DeclareOptionX{mouseover}{\@fancytooltips@mouseovertrue}
\newif\if@fancytooltips@inactive\@fancytooltips@inactivefalse
\DeclareOptionX{inactive}{\@fancytooltips@inactivetrue}
@@ -337,9 +414,19 @@
\newif\if@fancytooltips@active\@fancytooltips@activefalse
\DeclareOptionX{active}{\@fancytooltips@activetrue}
+\newif\if@fancytooltips@fg\@fancytooltips@fgfalse
+\DeclareOptionX{fg}{\@fancytooltips@fgtrue}
+
\DeclareOptionX{filename}{\xdef\TooltipFilename{#1}}
\DeclareOptionX{pages}{\xdef\TooltipPages{#1}}
+\newif\if@fancytooltips@blur\@fancytooltips@blurfalse
+\DeclareOptionX{blur}[0.4]{\@fancytooltips@blurtrue
+ \xdef\fancytooltips@transparency{#1}}
+
+\newif\if@fancytooltips@fixcolor\@fancytooltips@fixcolorfalse
+\DeclareOptionX{fixcolor}{\@fancytooltips@fixcolortrue}
+
\def\fancytooltipsdebugmsg{}
\DeclareOptionX{debug}{\def \fancytooltipsdebugmsg
{
@@ -355,10 +442,27 @@ if (this.getField("animtiph") == null)
\ProcessOptionsX
+\if@fancytooltips@blur
+\ifTooltip@usepdftex\else
+\@fancytooltips@blurfalse
+\AtEndDocument{\PackageWarning{fancytooltips}
+ {Blur option is incompatible with dvips. ^^J The option blur is turned off }}
+\fi
+\fi
+
+\ifTooltip@usepdftex\else
+\@fancytooltips@fgfalse
+\fi
+
\newdimen\buttontipwidth
\newdimen\buttontipheight
\newdimen\fancy@a
\newdimen\fancy@b
+\newdimen\fancy@layerHshift\fancy@layerHshift=0pt
+\newdimen\fancy@layerVshift\fancy@layerVshift=0pt
+\newdimen\fancy@button@Vshift \fancy@button@Vshift=0pt
+\newdimen\fancy@button@Hshift \fancy@button@Hshift=0pt
+\newtoks\pos@fancy@toks
\if@fancytooltips@active\@fancytooltips@inactivefalse\fi
@@ -375,6 +479,11 @@ if (this.getField("animtiph") == null)
\def\TooltipPage#1#2{}%
\let\TooltipExtratext\relax
\let\TooltipRefmark\relax
+\ifx\@ocg@makeknown\undefined
+ \def\@ocg@makeknown#1#2#3{}\fi
+\def\fancy@@pushButton#1#2#3#4#5#6#7#8{}
+\def\fancy@@anim@pushButton#1#2#3#4#5#6#7#8#9{}
+
\PackageWarning{fancytooltips}{Fancytooltips inactive}%
\expandafter\endinput\fi
@@ -409,15 +518,15 @@ if (this.getField("animtiph") == null)
\hss}%
\fi}
\ifTooltip@usepdftex
-\def\TooltipRefmark{\hbox {\raisebox{0.4em}{\includegraphics[width=0.7em]%
- {fancytipmark.pdf}}}}%
+\def\TooltipRefmark{\hbox {\smash{\raisebox{0.4em}{\includegraphics[width=0.7em]%
+ {fancytipmark.pdf}}}}}%
\else
-\def\TooltipRefmark{\hbox {\raisebox{0.4em}{\includegraphics[width=0.7em]%
- {fancytipmark.eps}}}}%
+\def\TooltipRefmark{\hbox {\smash{\raisebox{0.4em}{\includegraphics[width=0.7em]%
+ {fancytipmark.eps}}}}}%
\fi%\ifTooltip@usepdftex
}
-\ifcreatetips
+\if@fancytooltips@createtips
% \end{macrocode}
% This part (three lines) is processed if the option |createtips| is
% used. In the opposite case we process the second part, up to the end
@@ -430,7 +539,7 @@ if (this.getField("animtiph") == null)
% \end{macrocode}
% This part is processed if the option |createtips| is not used. We
% define macros which put the hidden button with the name |ikona.n| in
-% the backgoud of the page |n|, if one of the commands |\tooltip| or
+% the background of the page |n|, if one of the commands |\tooltip| or
% |\tooltipanim| has been used on this page. Javascripts defined by
% |\tooltip| and |\tooltipanim| commands then unhide this button and
% show the corresponding picture.
@@ -442,14 +551,14 @@ if (this.getField("animtiph") == null)
\ifTooltip@usepdftex
\RequirePackage[pdftex]{eforms}
-\def\TooltipExtratext{\hbox{\raisebox{0.4em}{\includegraphics[width=0.7em]%
- {fancytipmark.pdf}}}}
+\def\TooltipExtratext{\hbox{\smash{\raisebox{0.4em}{\includegraphics[width=0.7em]%
+ {fancytipmark.pdf}}}}}
\else
\RequirePackage[dvips]{eforms}
-\def\TooltipExtratext{\hbox{\raisebox{0.4em}{\includegraphics[width=0.7em]%
- {fancytipmark.eps}}}}
+\def\TooltipExtratext{\hbox{\smash{\raisebox{0.4em}{\includegraphics[width=0.7em]%
+ {fancytipmark.eps}}}}}
\fi%\ifTooltip@usepdftex
-\ifextratext\else\let\TooltipExtratext\relax\fi
+\if@fancytooltips@extratext\else\let\TooltipExtratext\relax\fi
\AtBeginDocument{
\global\buttontipwidth=\paperwidth
@@ -468,7 +577,7 @@ if (this.getField("animtiph") == null)
/BS << /W 1 /S /S >>
/MK << /TP 1 /IF <</A[1.0 1.0]/SW /B>> >>
}%
- \vbox to \buttontipheight {\vss\hbox to \buttontipwidth{\hss}}\pdfendlink}
+ \vbox to \buttontipheight {\vss\hbox to \buttontipwidth{\hss}}\pdfendlink}%
\else
% \end{macrocode}
% For dvips users we use the macros from eqxerquiz.sty package.
@@ -487,9 +596,25 @@ if (this.getField("animtiph") == null)
\textColor{0 g}\Ff{\FfReadOnly}
}
\def\frametip@{\eqIconFTT[\BC{}\BG{}\F{\FHidden}]%
- {ikona.\thepage}{\paperwidth}{\paperheight}}%
+ {ikona.\thepage}{\paperwidth}{\paperheight}%
+}%
\fi%\ifTooltip@usepdftex
+\def\fancytooltips@one{1}
+\if@fancytooltips@blur
+ \RequirePackage{ocg}
+ \ifx\fancytooltips@one\fancytooltips@transparency
+ \def\transparent#1{}
+ \else
+ \RequirePackage{transparent}
+ \fi
+\else
+ \ifx\@ocg@makeknown\undefined
+ \def\@ocg@makeknown#1#2#3{}\fi
+\fi
+
+\if@fancytooltips@fg\else
+\RequirePackage{eso-pic}
\def\frametip{%
\expandafter\ifx \csname TooltipPage\thepage\endcsname\relax
\else
@@ -497,6 +622,43 @@ if (this.getField("animtiph") == null)
\hbox{\raise \dp0 \box0}
\fi}%
\AddToShipoutPicture{\hbox to 0 pt{\frametip\hss}}
+\fi
+
+\def\fancytooltips@save@position{\pdfsavepos%
+ \write\@auxout{\string\global\string \fancy@layerVshift \the\pdflastypos sp\string\relax}%
+ \write\@auxout{\string\global\string \fancy@layerHshift \the\pdflastxpos sp\string\relax}%
+}
+
+\def\fancy@beginshipout@hook{}
+\AtBeginShipout{%
+\TooltipPageopencloseJS
+\setbox\AtBeginShipoutBox=\hbox{%
+ \hbox to 0 pt{\TooltipHidden}\global\def\TooltipHidden{}%
+ \fancy@beginshipout@hook\if@fancytooltips@fixcolor\hbox to 0 pt{\resizebox{1pt}{!}{\TooltipExtratext}\hss}\fi
+ \hbox{\box\AtBeginShipoutBox}%
+ \ifTooltip@usepdftex
+ \fancytooltips@save@position
+ \if@fancytooltips@blur
+ \expandafter\ifx \csname TooltipPage\thepage\endcsname\relax \else
+ \lower\fancy@layerVshift\hbox to 0 pt{\kern-\fancy@layerHshift\relax
+ \begin{ocg}{fancyOCG\thepage}{fancyOCG\thepage}{0}%
+ \expandafter\transparent\expandafter{\fancytooltips@transparency}%
+ \color{black}%
+ \vbox to 0 pt{\vss\hbox{\vrule width \paperwidth height \paperheight}}%
+ \end{ocg}\hss}%
+ \fi
+ \fi
+ \if@fancytooltips@fg
+ \expandafter\ifx \csname TooltipPage\thepage\endcsname\relax
+ \else
+ \lower\fancy@layerVshift\vbox to 0 pt{\vss\hbox to 0 pt{\kern-\fancy@layerHshift\relax\hbox{\frametip@}\hss}}%
+ \fi
+ \lower\fancy@layerVshift\vbox to 0 pt{\vss\hbox to 0 pt{\kern-\fancy@layerHshift\relax\hbox to 0 pt{\the\pos@fancy@toks\hss}}}%
+ \fi
+ \fi
+ }%
+}%
+
% \end{macrocode}
% In the macros |\tooltip| and |\tooltipanim| we print the text into
% box with zero dimensions and then we build a button which covers
@@ -532,37 +694,77 @@ if (this.getField("animtiph") == null)
\newcommand{\tooltip@Star}[2]{{\color{tooltipcolor}#1}%
{\let\SaveTooltipExtratext\TooltipExtratext
\let\TooltipExtratext\relax
- \hbox to 0 pt{\tooltip@NoStar{\strut\SaveTooltipExtratext}{#2}\hss}}}
+ \hbox to 0 pt{\tooltip@NoStar{\SaveTooltipExtratext
+ \vrule height 10pt depth 0 pt width 0 pt}{#2}\hss}}}
\newcommand{\tooltip@NoStar}[2]{%
\global\advance\tooltip@count by 1%
\edef\act{\write\@auxout{\noexpand\string\noexpand\TooltipPage{\the\tooltip@count}{\the\tooltip@pagetoks}}}\act
- \edef\tooltippage{\csname Tooltipcount2page\the\tooltip@count \endcsname}%
+ \expandafter\ifx\csname Tooltipcount2page\the\tooltip@count \endcsname\relax
+ \global\edef\tooltippage{}
+ \else
+ \global\edef\tooltippage{\csname Tooltipcount2page\the\tooltip@count \endcsname}%
+ \fi
\checkTipNumber{#2}\edef\TipNumber{\FindTipNumber{#2}}%
- \def\tempfancytooltips{}%
- \ifmovetips\edef\tempfancytooltips{nastav(\TipNumber,\tooltippage);}\fi
\leavevmode
- \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\hbox to 0 pt{\copy0\smash{\TooltipExtratext}\hss}%
- \fancy@a=\ht0
- \advance\fancy@a by \dp 0
- \fancy@b=0.5\fancy@a
- \advance\fancy@b by -\dp0
- \advance\fancy@b by -2bp
- \lower-\fancy@b\vtop{\hbox{%
- \pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\fancy@JS{CloseTooltips();}}%
- \ifmouseover
- \AAMouseEnter{\fancy@JS{this.getField("ikona."+(\tooltippage)).hidden=false;
+ \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\copy0\fancy@a=\dp0\advance\fancy@a by \ht0\relax\hbox to 0 pt{\smash{\TooltipExtratext}\hss}\fancy@pushButton{\TipNumber}{\tooltippage}{TooltipField}{\wd0}{\fancy@a}{\dp0}}
+
+\def\fancy@tooltip@options#1#2{\BC{}\BG{}
+ \S{}\AA{\AAMouseExit{\fancy@JS{CloseTooltips();}}%
+ \if@fancytooltips@mouseover
+ \AAMouseEnter{\fancy@JS{this.getField("ikona."+(#2)).hidden=false;
try {app.clearInterval(animace);}catch (e) {}
- \tempfancytooltips
- zobraz(\TipNumber,\tooltippage);
+ \if@fancytooltips@movetips nastav(#1,#2);\fi
+ \if@fancytooltips@blur
+ try{
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ if(fancytooltipsOCGs[i].name == "fancyOCG"+(#2))
+ fancytooltipsOCGs[i].state = true;
+ else
+ fancytooltipsOCGs[i].state = false;
+ }} catch (e) {};
+ \fi
+ zobraz(#1,#2);
}}
\fi}
- \A{\fancy@JS{this.getField("ikona."+(\tooltippage)).hidden=false;
+ \A{\fancy@JS{this.getField("ikona."+(#2)).hidden=false;
try {app.clearInterval(animace);}catch (e) {}
- \tempfancytooltips
- zobraz(\TipNumber,\tooltippage);
- }}]
- {TooltipField}{\wd0}{\fancy@a}}}}
+ \if@fancytooltips@movetips nastav(#1,#2);\fi
+ \if@fancytooltips@blur
+ try {
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ if(fancytooltipsOCGs[i].name == "fancyOCG"+(#2))
+ fancytooltipsOCGs[i].state = true;
+ else
+ fancytooltipsOCGs[i].state = false;
+ }} catch (e) {};
+ \fi
+ zobraz(#1,#2);
+ }}}
+
+\newtoks\@fxtoks\@fxtoks={\the\pdflastxpos}
+\newtoks\@fytoks\@fytoks={\the\pdflastypos}
+
+\def\fancy@pushButton#1#2#3#4#5#6{%
+ \lower #6\hbox to 0 pt{\hss\expandafter\pushButton\expandafter[\fancy@tooltip@options{#1}{#2}]{#3}{#4}{#5}}}
+\def\fancy@@pushButton#1#2#3#4#5#6#7#8{}
+
+\ifTooltip@usepdftex
+\if@fancytooltips@fg
+\def\fancy@pushButton#1#2#3#4#5#6{\pdfsavepos%
+ \edef\act{\write\@auxout{\string\fancy@@pushButton{#1}{#2}{#3}{\the#4}{\the#5}{\the\@fxtoks}{\the\@fytoks}{\the#6}}}\act%
+}
+\def\fancy@@pushButton#1#2#3#4#5#6#7#8{%
+ \expandafter\global\expandafter\pos@fancy@toks\expandafter{\the\pos@fancy@toks\fancy@onlypage{#2}{\vbox to 0 pt{\vss\hbox to 0 pt{\kern #6 sp\hbox to 0 pt{\hss\expandafter\pushButton\expandafter[\fancy@tooltip@options{#1}{#2}]{#3}{#4}{#5}}\hss}\kern #7sp\kern-#8}}}}
+\fi
+\fi
+
+
+\def\fancy@onlypage#1#2{\def\ft@a{#1}\edef\ft@b{\thepage}%
+\ifx\ft@a\ft@b#2\fi}
+
\def\delayinterval{200}
@@ -574,89 +776,182 @@ if (this.getField("animtiph") == null)
\newcommand{\tooltipanim@Star}[3]{{\color{tooltipcolor}#1}%
{\let\SaveTooltipExtratext\TooltipExtratext
\let\TooltipExtratext\relax
- \hbox to 0 pt{\tooltipanim@NoStar{\strut\SaveTooltipExtratext}{#2}{#3}\hss}}}
+ \hbox to 0 pt{\tooltipanim@NoStar{\SaveTooltipExtratext
+ \vrule height 10pt depth 0 pt width 0 pt}{#2}{#3}\hss}}}
\newcommand{\tooltipanim@NoStar}[3]{%
\global\advance\tooltip@count by 1%
\edef\act{\write\@auxout{\noexpand\string\noexpand\TooltipPage{\the\tooltip@count}{\the\tooltip@pagetoks}}}\act
- \edef\tooltippage{\csname Tooltipcount2page\the\tooltip@count \endcsname}%
+ \expandafter\ifx\csname Tooltipcount2page\the\tooltip@count \endcsname\relax
+ \global\edef\tooltippage{}
+ \else
+ \global\edef\tooltippage{\csname Tooltipcount2page\the\tooltip@count \endcsname}%
+ \fi
\checkTipNumber{#2}\edef\TipNumberA{\FindTipNumber{#2}}%
\checkTipNumber{#3}\edef\TipNumberB{\FindTipNumber{#3}}%
\leavevmode
- \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\hbox to 0 pt{\copy0\smash{\TooltipExtratext}\hss}%
- \def\tempfancytooltips{}%
- \ifmovetips\edef\tempfancytooltips{nastav(\TipNumberA,\tooltippage);}\fi
- \fancy@a=\ht0
- \advance\fancy@a by \dp 0
- \fancy@b=0.5\fancy@a
- \advance\fancy@b by -\dp0
- \advance\fancy@b by -2bp
- \lower-\fancy@b\vtop{\hbox{%
- \pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\fancy@JS{CloseTooltips();}}
- \ifmouseover
+ \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\copy0\fancy@a=\dp0\advance\fancy@a by \ht0\relax\hbox to 0 pt{\smash{\TooltipExtratext}\hss}\fancy@anim@pushButton{\TipNumberA}{\tooltippage}{TooltipField}{\wd0}{\fancy@a}{\dp0}{\TipNumberB}}
+
+
+\def\fancy@tooltipanim@options#1#2#3{
+\BC{}\BG{}\S{}\AA{\AAMouseExit{\fancy@JS{CloseTooltips();}}
+ \if@fancytooltips@mouseover
\AAMouseEnter{\fancy@JS{
try {app.clearInterval(animace);}catch (e) {}
- var cislo=\TipNumberA;
- \tempfancytooltips
+ var cislo=#1;
+ \if@fancytooltips@movetips nastav(#1,#2);\fi
+ \if@fancytooltips@blur
+ try{
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ if(fancytooltipsOCGs[i].name == "fancyOCG"+(#2))
+ fancytooltipsOCGs[i].state = true;
+ else
+ fancytooltipsOCGs[i].state = false;
+ }} catch (e) {};
+ \fi
function animuj()
{
var DirtyBeforeTooltipanim=this.dirty;
- if (cislo<\TipNumberB) cislo=cislo+1;
- this.getField('ikona.'+(\tooltippage)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon());
+ if (cislo<#3) cislo=cislo+1;
+ this.getField('ikona.'+(#2)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon());
this.dirty=DirtyBeforeTooltipanim;
};
- this.getField('ikona.'+(\tooltippage)).buttonSetIcon(this.getField("animtiph."+\TipNumberA).buttonGetIcon());
- this.getField("ikona."+(\tooltippage)).hidden=false;
+ this.getField('ikona.'+(#2)).buttonSetIcon(this.getField("animtiph."+#1).buttonGetIcon());
+ this.getField("ikona."+(#2)).hidden=false;
animace=app.setInterval('animuj();', \delayinterval);
}}
\fi}
\A{\fancy@JS{
try {app.clearInterval(animace);}catch (e) {}
- var cislo=\TipNumberA;
- \tempfancytooltips
+ var cislo=#1;
+ \if@fancytooltips@movetips nastav(#1,#2);\fi
+ \if@fancytooltips@blur
+ try{
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ if(fancytooltipsOCGs[i].name == "fancyOCG"+(#3))
+ fancytooltipsOCGs[i].state = true;
+ else
+ fancytooltipsOCGs[i].state = false;
+ }} catch (e) {};
+ \fi
function animuj()
{
var DirtyBeforeTooltipanim=this.dirty;
- if (cislo<\TipNumberB) cislo=cislo+1;
- this.getField('ikona.'+(\tooltippage)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon());
+ if (cislo<#3) cislo=cislo+1;
+ this.getField('ikona.'+(#2)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon());
this.dirty=DirtyBeforeTooltipanim;
};
- this.getField('ikona.'+(\tooltippage)).buttonSetIcon(this.getField("animtiph."+\TipNumberA).buttonGetIcon());
- this.getField("ikona."+(\tooltippage)).hidden=false;
+ this.getField('ikona.'+(#2)).buttonSetIcon(this.getField("animtiph."+#1).buttonGetIcon());
+ this.getField("ikona."+(#2)).hidden=false;
animace=app.setInterval('animuj();', \delayinterval);
}}
- ]{TooltipField}{\wd0}{\fancy@a}}}}
+}
+
+
+\def\fancy@anim@pushButton#1#2#3#4#5#6#7{%
+ \lower #6 \hbox to 0 pt{\hss\expandafter\pushButton\expandafter[\fancy@tooltipanim@options{#1}{#2}{#7}]{#3}{#4}{#5}}}
+\def\fancy@@anim@pushButton#1#2#3#4#5#6#7#8#9{}
+
+\ifTooltip@usepdftex
+\if@fancytooltips@fg
+\def\fancy@anim@pushButton#1#2#3#4#5#6#7{\pdfsavepos%
+ \edef\act{\write\@auxout{\string\fancy@@anim@pushButton{#1}{#2}{#3}{\the#4}{\the#5}{\the\@fxtoks}{\the\@fytoks}{\the#6}{#7}}}\act%
+}
+\def\fancy@@anim@pushButton#1#2#3#4#5#6#7#8#9{%
+ \expandafter\global\expandafter\pos@fancy@toks\expandafter{\the\pos@fancy@toks\fancy@onlypage{#2}{\vbox to 0 pt{\vss\hbox to 0 pt{\kern #6 sp\hbox to 0 pt{\hss\expandafter\pushButton\expandafter[\fancy@tooltipanim@options{#1}{#2}{#9}]{#3}{#4}{#5}}\hss}\kern #7sp\kern-#8}}}}
+\fi
+\fi
+
+
% \end{macrocode}
% This code closes tooltip if the page is closed.
% \begin{macrocode}
+\edef\fancytooltips@pdfpageattrJS{%
+ var DirtyBeforeCloseTooltip=this.dirty;
+ \if@fancytooltips@blur
+ try{
+ var temp = fancytooltipsOCGs.length;
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ fancytooltipsOCGs[i].state = false;
+ }
+ }
+ catch (e){}
+ \fi
+ CloseTooltips();
+ this.dirty=DirtyBeforeCloseTooltip;
+}
\ifTooltip@usepdftex
-\def\TooltipPageopencloseJS{ \global\pdfpageattr{%
- /AA << /O << /S /JavaScript /JS (
- var DirtyBeforeCloseTooltip=this.dirty; CloseTooltips(); this.dirty=DirtyBeforeCloseTooltip;) >> >>}%
+\edef\fancy@temp{/AA << /O << /S /JavaScript /JS (
+ \fancytooltips@pdfpageattrJS) >> >>}
+\expandafter\def\expandafter\TooltipPageopencloseJS\expandafter{
+\expandafter\global\expandafter\pdfpageattr\expandafter{\fancy@temp}%
}
\pdfximage{\TooltipFilename.pdf}%
\edef\TooltipPages{\the\pdflastximagepages}%
\else
-\def\TooltipPageopencloseJS{
-\literalps@out{%
- [ {ThisPage} << /AA <<
+\edef\fancy@temp{ [ {ThisPage} << /AA <<
/O << /S /JavaScript /JS (var DirtyBeforeCloseTooltip=this.dirty; CloseTooltips(); this.dirty=DirtyBeforeCloseTooltip;) >>
- >> >> /PUT pdfmark}}
-\OpenAction{/S /JavaScript /JS (var DirtyBeforeCloseTooltip=this.dirty; CloseTooltips(); this.dirty=DirtyBeforeCloseTooltip;)}
+ >> >> /PUT pdfmark}
+\expandafter\def\expandafter\TooltipPageopencloseJS\expandafter{
+\expandafter\literalps@out\expandafter{\fancy@temp}}
+\edef\fancy@@temp{/S /JavaScript /JS ( \fancytooltips@pdfpageattrJS)}
+\expandafter\OpenAction\expandafter{\fancy@@temp}
\fi%\ifTooltip@usepdftex
-\EveryShipout{\TooltipPageopencloseJS}%
\ifTooltip@usepdftex
+\def\fancytempA{}
+\ifx\FancytooltipsAfterClose\undefined\else\edef\fancytempA{\FancytooltipsAfterClose}\fi
+\def\fancytempAA{}
+\ifx\FancytooltipsAfterShow\undefined\else\edef\fancytempAA{\FancytooltipsAfterShow}\fi
+
+\if@fancytooltips@blur
+\def\fancytempAAA{
+% \end{macrocode}
+% OCG's have not been initialized yet, do it now.
+% \begin{macrocode}
+ var inifancytooltipsOCGs = this.getOCGs();
+ var fancytooltipsOCGs = [];
+ for(var i=0; inifancytooltipsOCGs && i<inifancytooltipsOCGs.length;i++)
+ {
+ if(inifancytooltipsOCGs[i].name.substr(0,5) == "fancy")
+ {
+ fancytooltipsOCGs.push(inifancytooltipsOCGs[i]);
+ inifancytooltipsOCGs[i].state=false;
+ }
+ }
+ inifancytooltipsOCGs[0].state=true;
+ inifancytooltipsOCGs[0].state=false;
+}
+\else
+\def\fancytempAAA{}
+\fi
+
+\if@fancytooltips@blur
+\def\fancytempB{
+ try {for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {fancytooltipsOCGs[i].state = false;} } catch (e) {}}
+\else
+\def\fancytempB{}
+\fi
+
+
\begin{insDLJS}[fancyTooltipsLoaded]{Tooltipsdljs}{DLJS for Tooltips}
\fancytooltipsdebugmsg
var animace;
var fancyTooltipsLoaded = true;
+ \fancytempAAA
+
function CloseTooltips()
{
try {this.getField("ikona").hidden=true;}catch (e) {}
try {app.clearInterval(animace);}catch (e) {}
+ \fancytempB
+ \fancytempA
}
function nastav(cislo,strana)
@@ -684,6 +979,7 @@ if (this.getField("animtiph") == null)
var g=this.getField("animtiph."+cislo);
f.hidden=false;
f.buttonSetIcon(g.buttonGetIcon());
+ \fancytempAA
}
this.dirty=false;
@@ -785,7 +1081,6 @@ if (this.getField("animtiph") == null)
\egroup
\advance\count@\@ne}%
}
-\AddToShipoutPicture*{\hbox to 0 pt{\TooltipHidden}}
\else
\let\TooltipHidden\relax
\fi
@@ -806,7 +1101,7 @@ if (this.getField("animtiph") == null)
#1\else\csname FancyToolTip@#1\endcsname\fi}
\def\checkTipNumber#1{\expandafter\ifx
- \csname FancyToolTip@#1\endcsname\relax \PackageWarning{fancytooltips}{No
+ \csname FancyToolTip@#1\endcsname\relax \PackageInfo{fancytooltips}{No
framenumber is assigned to keyword #1. I assume that #1 is the
number of the frame.}%
\fi}