% Documentstyle option `draw' by Christoph Strunk.
%
% This is intended to be used with special output drivers,
% that support the CSG-\special commands.
%
% Version 0.9 as of 15.02.92
%
% Please note: This file is somewhat experimental and subject to change
%              without notice. You will probably want to use your own
%              CSG binding instead.
%
% History:
%  Version 0.7: Now compatible with \label and \ref
%  Version 0.8: Comment out some old and obsolete commands
%  Version 0.9: Put picture into a minipage and add some drawing commands
%
% Usage from LaTeX:
%  \begin{draw}{240}{240}{Der Tiger} \label{tiger-bild} ... \end{draw}
%

\message{Document style option `draw' version 0.9 as of 15 Feb 1992}

%
% Please do not change anything here. If you want a different style,
% You should do a \renewcommand{\drawtitle}{...} and/or
% \renewcommand{\drawtop}{...} and/or \renewcommand{\drawbottom}{...}
%

\newcommand{\picturefont}{\tensf}% setup default value

\newcounter{draw}

\newcommand{\drawtitle}{\begin{center}Bild \arabic{draw}: \picturetitle
 \end{center}}
\newcommand{\drawtop}{\medbreak\begin{minipage}{\textwidth}\begin{center}}
\newcommand{\drawbottom}{\end{center}\drawtitle\end{minipage}\medbreak}

\newenvironment{draw}[3]{%
\def\picturetitle{#3}\special{CS!r}\special{CS!u\the\unitlength}\drawtop
 \begin{picture}(#1,#2)\refstepcounter{draw}}{\end{picture}\drawbottom}

%
% The following commands may be used from inside any draw or picture
% environment:
%

% Commands working in any CSG level

\def\UnitLength#1{\unitlength #1\special{CS!u \the\unitlength}}
\def\LineType#1{\special{CS!t #1}}
\def\Line(#1,#2){\special{CS!l #1 #2}}
\def\IncludeCSG#1{\special{CS!i #1}}

%
% Commands working in CSG level 2 (and up) only !
%
% CSG level 2 is fully supported since driver family 3.09.7cs
% (some beta-test versions before don't implement CS!c0 and CS!d0)
%

\def\LineWidth#1{\special{CS!w #1}}		% i.e. \LineWidth{1.5pt}
\def\ThinLines{\thinlines\LineWidth{0.4pt}}
\def\ThickLines{\thicklines\LineWidth{0.8pt}}
\def\LineThickness#1{\linethickness{#1}\LineWidth{#1}}

\def\EllipticalArc(#1,#2,#3,#4,#5){\special{CS!a #1 #2 #3 #4 #5}}
\def\QuadraticBezier(#1,#2)(#3,#4){\special{CS!b2 #1 #2 #3 #4}}
\def\CubicBezier(#1,#2)(#3,#4)(#5,#6){\special{CS!b3 #1 #2 #3 #4 #5 #6}}
\def\Circle{\@ifstar{\@Dot}{\@Circle}}  % defines \Circle{} and \Circle*{}
\def\@Circle#1{\special{CS!c0 #1}}	% use i.e. \Circle{1.2}
\def\@Dot#1{\special{CS!d0 #1}}		% use i.e. \Circle*{1.2}
\def\FilledEllipse(#1,#2){\special{CS!e #1 #2}}

% -eof-
