\chapter{Introduction}
\markboth{Introduction}{}

\section{Product overview}
\markright{Product overview}

\program{pic} is a \program{troff}~\cite{unixtype2:book, unixtype1:book} 
pre-processor for drawing pictures that are included in \program{troff} documents~\cite{unixtype2:book, bk:pic, unixtype1:book}. \program{WD-pic}, 
as the name suggests, is a \textbf{W}YSIWYG (What You See Is What You 
Get), \textbf{D}irect-manipulation \textbf{\program{pic}}, a picture 
drawing program with the interchangeability of batch and WYSIWYG. It is 
built on top of the \program{pic} program, using the \program{pic} language as its internal picture representation. Therefore, it is an enhancement of the \program{pic} program.
 
It has been observed that the \program{pic} language is well suited for drawing computer science technical document illustrations, such as flow charts and state diagrams. Thus, \program{WD-pic} is also intended mainly for these kinds of diagrams. Figure~\ref{fig:flowdiagram} shows a flow diagram generated from the \program{pic} code shown in Figure~\ref{fig:flowcode}. 

\begin{figure}
\begin{center}
\includegraphics{flowdiagram.ps}
\end{center}
\caption{A flow diagram}\label{fig:flowdiagram}
\end{figure}

\begin{figure}
\begin{flushleft}
\hspace{2in}	\code{ellipse} \codequote\code{document}\codequote \\ 
\hspace{2in}	\code{arrow} \\
\hspace{2in}	\code{box} \codequote\code{WD-pic}\codequote \\
\hspace{2in}	\code{arrow} \\
\hspace{2in}	\code{box} \codequote\code{troff}\codequote \\
\hspace{2in}	\code{arrow} \\
\hspace{2in}	\code{ellipse} \codequote\code{typesetter}\codequote
\end{flushleft}
\caption{\program{pic} code of Figure~\ref{fig:flowdiagram}}\label{fig:flowcode}
\end{figure}

\program{WD-pic} runs on the \program{Solaris UNIX} environments with the \program{JAVA} runtime environment, version 1.3.1 or later.

\section{First sample run}
\markright{First sample run}

The picture in Figure~\ref{fig:flowdiagram} can be easily drawn with \program{WD-pic}. To start the program, run the following command:

\cmmdcon{wdpic} [\cmmdvar{filename}]

\cmmdvar{filename} is an optional parameter, specifying the name of an existing file to load as the internal representation on start-up, or the name of a non-existent file that will receive the current internal representation whenever \wid{Save} of the \wid{File} menu is requested.

The screen layout of \program{WD-pic} is illustrated in Figure~\ref{fig:screen}.   

\begin{figure}
\begin{center}
\epsfig{figure=screenlayout.eps, width=6.5in}
\end{center}
\caption{Screen layout of \program{WD-pic}}\label{fig:screen}
\end{figure}

The following steps show one way to draw Figure~\ref{fig:flowdiagram}. You will learn other ways to draw the same picture in later sections.

\begin{enumerate}
\item Left mouse click the \wid{ellipse} button on the palette, and input \widquote\ \wid{d o c u m e n t} \widquote\footnote{White space is used to separate tokens; a blank token is denoted ``\textvisiblespace ''.} from the keyboard, without moving the mouse.
\item Left mouse click the \wid{arrow} button.
\item Left mouse click the \wid{box} button, and input \widquote\ \wid{W D - p i c} \widquote\ from the keyboard, without moving the mouse.
\item Left mouse click the \wid{arrow} button.
\item Left mouse click the \wid{box} button, and input \widquote\ \wid{t r o f f} \widquote\ from the keyboard without moving the mouse.
\item Left mouse click the \wid{arrow} button.
\item Left mouse click the \wid{ellipse} button, and input \widquote\ \wid{t y p e s e t t e r} \widquote\ from the keyboard without moving the mouse.
\end{enumerate}

As you are doing the above operations, the internal representation shown in Figure~\ref{fig:flowcode} is generated in the editing window and the picture shown in Figure~\ref{fig:flowdiagram} is drawn on the canvas, as illustrated in Figure~\ref{fig:firstsample}. 
 
\begin{figure}
\begin{center}
\epsfig{figure=firstsample.eps, width=6.0 in, height=4.5 in}
\end{center}
\caption{First sample}\label{fig:firstsample}
\end{figure}
