%%
%% This is file `pst-lens.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pst-lens.dtx  (with options: `pst-lens')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from pst-lens.tex.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file pst-lens.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%% Package `pst-lens.dtx'
%%
%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr> and
%% Manuel Luque <Mluque5130@aol.com> (France)
%%
%% February 19, 2001
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `pst-lens' is a PSTricks package to define a generic lens, which can be
%%   used on texts and graphics.
%%
\def\fileversion{1.0}
\def\filedate{2001/02/19}
\message{`PST-Lens' v\fileversion, \filedate\space
         (Denis Girou and Manuel Luque)}
\csname PSTLensLoaded\endcsname
\let\PSTLensLoaded\endinput
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\GradientLoaded\endinput\else\input pst-grad.tex\fi
\input pst-key.tex
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax
\newif\ifPstLens@Handle
\define@key{psset}{LensHandle}[true]{\@nameuse{PstLens@Handle#1}}
\define@key{psset}{LensStyleHandle}{\edef\PstLens@StyleHandle{#1}}
\newdimen\PstLens@HandleWidth
\define@key{psset}{LensHandleWidth}{\pssetlength{\PstLens@HandleWidth}{#1}}
\define@key{psset}{LensHandleHeight}{\edef\PstLens@HandleHeight{#1}}
\newif\ifPstLens@Shadow
\define@key{psset}{LensShadow}[true]{\@nameuse{PstLens@Shadow#1}}
\define@key{psset}{LensStyleGlass}{\edef\PstLens@StyleGlass{#1}}
\define@key{psset}{LensSize}{\edef\PstLens@Size{#1}}
\define@key{psset}{LensMagnification}{\edef\PstLens@Magnification{#1}}
\define@key{psset}{LensRotation}{\edef\PstLens@Rotation{#1}}
\setkeys{psset}{%
LensHandle=true,LensHandleWidth=0.2,LensHandleHeight=2.5,
LensStyleHandle=LensStyleHandle,
LensShadow=true,LensStyleGlass=LensStyleGlass,
LensRotation=0,LensSize=1,LensMagnification=1}
\newcmykcolor{Brown}{0 0.81 1 0.6}
\newcmykcolor{Salmon}{0 0.53 0.38 0}
\newpsstyle{LensStyleHandle}{%
fillstyle=gradient,framearc=0.6,linewidth=0.5\pslinewidth,
gradmidpoint=0.5,gradangle=\PstLens@Rotation,gradbegin=Brown,gradend=Salmon}
\newpsstyle{LensStyleGlass}{%
fillstyle=solid,fillcolor=white,
shadow=true,shadowcolor=lightgray,shadowsize=0.15,
shadowangle=\PstLens@Rotation}
\def\PstLensShape{\pscircle{1}}
\def\PstLens{\@ifnextchar[{\PstLens@i}{\PstLens@i[]}}
\def\PstLens@i[#1]{\@ifnextchar({\PstLens@ii[#1]}{\PstLens@ii[#1](0,0)}}
\def\PstLens@ii[#1](#2,#3)#4{{%
\setkeys{psset}{#1}%
\SpecialCoor
\rput{\PstLens@Rotation}(#2,#3){%
  \ifPstLens@Handle
    \scalebox{\PstLens@Size}{%
      \divide\PstLens@HandleWidth\tw@
      \psframe[style=\PstLens@StyleHandle]
              (-\PstLens@HandleWidth,0)
              (\PstLens@HandleWidth,-\PstLens@HandleHeight)}%
  \fi}
\psclip{{\psset{style=\PstLens@StyleGlass}
         \ifPstLens@Shadow
         \else
           \psset{shadow=false}
         \fi
         \rput(#2,#3){\psset{unit=\PstLens@Size}\PstLensShape}}}
  \rput(! 1 \PstLens@Magnification\space sub #2\space mul
          1 \PstLens@Magnification\space sub #3\space mul){%
    \scalebox{\PstLens@Magnification}{#4}}
\endpsclip}}
\catcode`\@=\PstAtCode\relax
\endinput
%%
%% End of file `pst-lens.tex'.
