% `special' commands for version 1.53 of graphs.sty. Frank Drewes, 16/11 2003

\def\ps@s{ }
\def\ps@convertnum#1{
	#1 \number\unitlength\ps@s mul 65536 div 72.27 div 72 mul
}

%-----------------------------------------------------------------------------%


\def\ps@rectangle[#1,#2]{% width, height
\special{"	\ps@convertnum{#1}
		\ps@convertnum{#2}
		[ \g@ncolour\ps@s\g@ncolourmod ]\ps@s
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		\iffillednodes true \else false\fi\ps@s
		psrectangle}}

%-----------------------------------------------------------------------------%

\def\ps@circle[#1]{% diameter
\special{"	\ps@convertnum{#1}
		[ \g@ncolour\ps@s\g@ncolourmod ]\ps@s
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		\iffillednodes true \else false\fi\ps@s
		pscircle}}

%-----------------------------------------------------------------------------%

\def\ps@line(#1,#2){% end x, end y
\special{"	\ps@convertnum{#1}
		\ps@convertnum{#2}
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\g@ldash\ps@s
		psline}}

%-----------------------------------------------------------------------------%

\def\ps@loopA(#1,#2)(#3,#4){% from (#1,#2) to (#3,#4)
\special{"	\ps@convertnum{#1}
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		\ps@convertnum{#4}
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		psloop}}

%-----------------------------------------------------------------------------%

\def\ps@loopB#1(#2,#3){% angle #1, axis (#2,#3)
\special{"	#1
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		psloopbyangle
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		psloop}}
		
%-----------------------------------------------------------------------------%

\def\ps@looparrowonrectangleA(#1,#2)(#3,#4)[#5,#6]{% 
\special{"	\ps@convertnum{#1}
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		\ps@convertnum{#4}
		\ps@convertnum{#5}
		\ps@convertnum{#6}
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		\ps@convertnum{\g@alength}\g@alengthmod\ps@s
		\g@awidth\ps@s\g@awidthmod\ps@s
		\g@atype\ps@s
		pslooparrowonrectangle}}

%-----------------------------------------------------------------------------%

\def\ps@looparrowoncircleA(#1,#2)(#3,#4)[#5]{% 
\special{"	\ps@convertnum{#1}
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		\ps@convertnum{#4}
		\ps@convertnum{#5}
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		\ps@convertnum{\g@alength}\g@alengthmod\ps@s
		\g@awidth\ps@s\g@awidthmod\ps@s
		\g@atype\ps@s
		pslooparrowoncircle}}

%-----------------------------------------------------------------------------%

\def\ps@looparrowonrectangleB#1(#2,#3)[#4,#5]{% 
\special{"	#1
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		psloopbyangle
		\ps@convertnum{#4}
		\ps@convertnum{#5}
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		\ps@convertnum{\g@alength}\g@alengthmod\ps@s
		\g@awidth\ps@s\g@awidthmod\ps@s
		\g@atype\ps@s
		pslooparrowonrectangle}}

%-----------------------------------------------------------------------------%

\def\ps@looparrowoncircleB#1(#2,#3)[#4]{% 
\special{"	#1
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		psloopbyangle
		\ps@convertnum{#4}
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		\ps@convertnum{\g@alength}\g@alengthmod\ps@s
		\g@awidth\ps@s\g@awidthmod\ps@s
		\g@atype\ps@s
		pslooparrowoncircle}}

%-----------------------------------------------------------------------------%

\def\ps@deletebox(#1,#2){% width, height in scaled points
\special{"	#1 65536 div
		#2 65536 div
		psdeletebox}}

%-----------------------------------------------------------------------------%

\def\ps@arrowonrectangle(#1,#2) [#3,#4]{% x, y, width, height
\special{"	\ps@convertnum{#1}
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		\ps@convertnum{#4}
		\ps@convertnum{\g@alength}\g@alengthmod\ps@s
		\g@awidth\ps@s\g@awidthmod\ps@s
		\g@atype\ps@s
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		psarrowonrectangle}}

%-----------------------------------------------------------------------------%

\def\ps@arrowoncircle(#1,#2) [#3]{% x, y, diameter of circle
\special{"	\ps@convertnum{#1}
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		\ps@convertnum{\g@alength}\g@alengthmod\ps@s
		\g@awidth\ps@s\g@awidthmod\ps@s
		\g@atype\ps@s
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		\g@ldash\ps@s
		psarrowoncircle}}

%-----------------------------------------------------------------------------%

\def\ps@path(#1,#2)#3{% start coordinates, (xi,yi[,di]) ...
	\def\extractvalues(##1)##2;{%
	  \ifx\endmarker##1\else%
	    \extractvalues##2;\extractvals(##1,0,)%
	  \fi}%
	\def\extractvals(##1,##2,##3,##4){%
	  \ps@convertnum{##1}%
	  \ps@convertnum{##2}%
	  ##3%
	}%
	\special{" mark \extractvalues#3(\endmarker);
			\ps@convertnum{#1}
			\ps@convertnum{#2}
			\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
			[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
			\g@ldash\ps@s
			[ \g@fcolour\ps@s\g@fcolourmod ]\ps@s
			\iffilledareas true \else false\fi\ps@s pspath}}

%-----------------------------------------------------------------------------%

\def\ps@curve#1#2{% base length, (x1,y1,ang1[factor1]) ...
	\def\extractvalues(##1(##2;##3{%
	  \ifx\endmarker##1\else%
	    \extractvalues(##2;{##3}\extractvals(##1[##3,##3];%
	  \fi}%
	\def\extractvals(##1,##2,##3)[##4,##5]##6;{%
	  ##5\ps@s
	  ##4\ps@s
	  ##3\ps@s
	  \ps@convertnum{##2}%
	  \ps@convertnum{##1}%
	}%
	\special{" mark \extractvalues#2(\endmarker(;{#1}
			\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
			[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
			\g@ldash\ps@s
			[ \g@fcolour\ps@s\g@fcolourmod ]\ps@s
			\iffilledareas true \else false\fi\ps@s pscurve}}

%-----------------------------------------------------------------------------%

\def\ps@bubble#1#2{% length factor, (x1,y1) ...
	\def\extractvalues(##1)##2;{%
	  \ifx\endmarker##1\else%
	    \extractvalues##2;\extractvals(##1)%
	  \fi}%
	\def\extractvals(##1,##2){%
	  \ps@convertnum{##2}%
	  \ps@convertnum{##1}%
	}%
	\special{" mark \extractvalues#2(\endmarker);
			#1\ps@s
			\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
			[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
			\g@ldash\ps@s
			[ \g@fcolour\ps@s\g@fcolourmod ]\ps@s
			\iffilledareas true \else false\fi\ps@s psbubble}}

%-----------------------------------------------------------------------------%

\def\ps@dirbowoncircle(#1,#2)(#3,#4,#5)[#6]{% (x1,x2) (y1,y2,d), radius
\special{"	\ps@convertnum{#1}
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		\ps@convertnum{#4}
		#5\ps@s
		\ps@convertnum{#6}
		\ps@convertnum{\g@alength}\g@alengthmod\ps@s
		\g@awidth\ps@s\g@awidthmod\ps@s
		\g@atype\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\g@ldash\ps@s
		psdirbowoncircle}}

%-----------------------------------------------------------------------------%

\def\ps@dirbowonrectangle(#1,#2)(#3,#4,#5)[#6,#7]{% (x1,x2) (y1,y2,d),
                                                  % xsize, ysize
\special{"	\ps@convertnum{#1}
		\ps@convertnum{#2}
		\ps@convertnum{#3}
		\ps@convertnum{#4}
		#5\ps@s
		\ps@convertnum{#6}
		\ps@convertnum{#7}
		\ps@convertnum{\g@alength}\g@alengthmod\ps@s
		\g@awidth\ps@s\g@awidthmod\ps@s
		\g@atype\ps@s
		\ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
		[ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
		\g@ldash\ps@s
		psdirbowonrectangle}}

%-----------------------------------------------------------------------------%

