.TH gremlin "" "" "X Application"
.PC "Picture editor"
.fi
\fBgremlin
[\-g \fIdisplay\^\fB]
[\-h]
[\-v]
[\-p \fIpath\^\fB]
[\fIfile\^\fB]\fR
.PP
.B gremlin
is an interactive editor for producing line drawings.
.\"It is currently configured to run on an AED512 display with a corresponding
.\"text terminal.
Commands are included for drawing simple elements such
as polygon, circles, and text in a variety of fonts or line styles.
Elements can also be grouped together and manipulated as sets.
.\"More a more detailed description, see the 
.\".I gremlin
.\"users manual.
.SH "Command-line Options"
.B gremlin
recognizes the following command-line switches:
.IP "\fB\-g \fIdisplay\fR"
Use
.IR display .
By default,
.B gremlin
uses the display named in the environmental variable
.BR DISPLAY .
.IP \fB\-h\fR
Use a horizontal orientation for the
drawing area, with the menu displayed across the top.
.IP \fB\-v\fR
Use a vertical orientation for the drawing area,
with the menu displayed along the left side.
This is the default.
.IP "\fB\-p \fIpath\fR"
Look up files in the directories named in the
.IR path .
If this is not set,
.B gremlin
looks for files in the current directory.
.SH Commands
You can give commands to
.B gremlin
either by selecting them from the menu or by pressing keys.
To select a command from the menu,
move the mouse cursor on or near the command's icon and
clicking the left-mouse button.
.\"The cursor is moved by a 'mouse' on the digitizer.  The mouse has
.\"four buttons: green, white, yellow, and blue used to place points,
.\"delete points, invoke commands, and undo commands respectively.
.PP
Most commands are accomplished by specifying one or more temporary
points and performing some action on the points.
If you put down more points than the command uses,
.B gremlin
discards the excess points.
.PP
Text commands may be either short, single-character commands or longer
commands that begin with a `:'.
The characters for the short commands are not necessarily mnemonic
and were selected for convenience of typing.
With a few exceptions, all of the short commands lie under
the left hand during normal typing.
.PP
The following lists the commands available under
.B gremlin
and explains their use:
.IP "\fB<ctrl-L>\fR \(em Update Screen"
The command
.B delete
may leave blank patches (or ``holidays'')
on the screen where objects overlapped.
These blank spots do not actually exist in the picture;
to remove them, use this command to update the screen.
.IP "\fB!\fR \(em Shell Escape"
This command passes the remainder of the lines to the shell,
for it to execute.
.IP "\fB1,2,3,4\fR \(em Save current set into numbered buffer"
Copy the current set of shapes into the specified buffer
for possible later retrieval.  
.IP "\fBA\fR \(em Draw Arc"
This command uses three points to define an arc.
The first point determines
the center of a circle.
The second defines a radius, and thus is a point on the circle.
The third point is optional; if specified, it determines a 
counter-clockwise angle from the second point that is the extent of the arc.
If the third point is omitted or the angle is 0,
.B gremlin
draws a full circle.
.IP "\fBB\fR \(em Draw Curve"
Draw a smooth curve through the specified points.
.IP "\fBC\fR \(em Copy Current Set"
Copying uses two or more points.
Copying resembles translation, except
that a copy of the current set is displaced to each of the remaining points.
.IP "\fBD\fR \(em Define Current Set"
This command uses points to select elements for the current set.
The points should be near, or touching, the reference points of the desired
elements.
(Gravity can be used to aid when laying down the points).
If no points are specified, the entire picture becomes the current set.
The previous contents of the current set are no longer selected.
.IP "\fBE\fR \(em Erase"
Erase all elements currently defined in the current set.
.IP "\fBF\fR \(em Select Area for Current Set"
Define the area that comprises the current set.
To do so, select two endpoints, which mark the diagonal corners of a rectangle.
.B gremlin
selects for the current set all elements that lie
.I entirely
within the rectangle.
The previous elements of the current set are no longer selected.
The rectangle is not displayed.
.IP "\fBG\fR \(em Toggle Gravity"
When on, gravity forces a point to coincide with the nearest
existing point or reference point.
Gravity only takes effect, however,
if the cursor is near enough to an element in the picture.
.IP "\fBL\fR \(em Update Text Screen"
Clear and redisplay the text screen.
.IP "\fBQ\fR \(em Display Grid"
Toggle displaying of a display grid on the graphic screen.
The grid's cells are 16 pixels wide.
.IP "\fBR\fR \(em Rotate Current Set"
To rotate the current set, define three points.
.B gremlin
rotates the current set relative to the first point,
through an angle formed by the lines
between points 1 and 2 and points 1 and 3, respectively.
.IP "\fBS\fR \(em Scale Current Set"
Scaling uses three points to define a transformation.
.B gremlin
scales the current set by the ratio of the distances
between the first and second and the first and third points.
.IP "\fBT\fR \(em Translate Current Set"
To translate (that is, move) the current set, define two points.
.B gremlin
moves the current set a distance equivalent to the distance between
the two points you define.
.IP "\fBV\fR \(em Draw Vectors"
This command connects with lines
each of the points laid down, in the order specified.
.IP "\fBW\fR \(em Draw Arrowhead"
This command uses two points.
The first marks where to draw the tip of the arrowhead;
the second marks the direction in which the arrow is to point. 
.IP "\fBX\fR \(em Draw Box"
This command uses two points, which define two diagonal corners of the box.
.IP "\fBZ\fR \(em Manhattan Adjust"
This command
combines horizontal and vertical adjustment
to force each point to be directly horizontal or
vertical with respect to the previous point, whichever it is closer to.
The resulting picture consists of sharp horizontal and vertical lines and
so resembles the Manhattan skyline \(em hence, its name.
.IP "\fB:align \fIn\fR \(em Alignment"
Align all points on the pixel boundary
.IR n .
For example, the command
.B ":align 10"
forces all points to fall on pixels whose addresses are evenly divisible
by ten.
If no parameter is given, this command toggles alignment between one and
the size of the grid.
.IP "\fB:brush \fIn\fR \(em Select Brush"
Use brush
.IR n .
Currently, six types of brush are available:
.BR dotted ,
.BR broken ,
.BR thick ,
.BR dashed ,
.BR narrow ,
and
.BR medium .
.I n
can be from one to six, where one corresponds to brush type
.B dotted
and six to
.BR medium ,
in the order given above.
.IP "\fB:buffer \fIn\fR \(em Retrieve Set Buffer"
Copy the contents of set buffer
.I n
into the picture.
.B gremlin
one copy of the set buffer at every point you place.
.IP "\fB:clearpoints\fR \(em Clear Points"
Clear (that is, remove) all points on the screen that are unused.
.IP "\fB:deletepoint\fR \(em Delete a Point"
Erase the last point specified.
This is the same as clicking the delete-point button on the cursor.
.IP "\fB:edit\fR \(em Edit File"
This command opens a new file for editing.
Except for any symbols defined in the menu buffers,
.B gremlin
does not save the current picture,
.IP "\fB:font \fIn\fR \(em Select Font"
Select any of the fonts
.BR Roman ,
.BR Italics ,
.BR Bold ,
or
.BR Special .
.I n
is a number one through four that corresponds to the font you want,
in the order given in the above list.
.IP "\fB:gripe\fR \(em Leave a Message"
This command displays the e-mail address of the person who currently
maintains
.BR gremlin .
.IP "\fB:hadjust\fR \(em Horizontal Adjust"
Toggle horizontal adjustment.
When on,
.B gremlin
forces each point to lie on the same horizontal line
as the previous point.
This is useful when you want to draw a line that is straight horizontally.
.IP "\fB:includeset\fR \(em Include in Current Set"
Add the selected elements to the current set.
.IP "\fB:justify \fIVH\fR \(em Text-Justification Mode"
This command specifies the mode by which text is justified.
Text can be justified at the bottom, center, or top vertically;
and at the left, center, or right horizontally.
The argument
.I VH
gives two one-character codes that indicate the vertical
and horizontal justification.
For example, the code
.B BL
justifies text on the bottom left.
.IP "\fB:littlepoint\fR \(em Point-Size Control"
Toggles the point display between the standard `+' followed
by an integer, and a smaller `+' with no number.
.IP "\fB:mbrush \fIbrush\fR \(em Modify Brush"
Redraw in
.I brush
the elements in the current set.
The brushes are listed above.
.IP "\fB:mfont \fIfont\fR \(em Modify Font"
Redisplay all text in
.IR font .
The fonts are given above.
.IP "\fB:mirror\fR \(em Mirror Current Set"
Mirror the current set.
You must define three points:
the mirroring takes
place about the X or Y axes, respectively, if the third point is on the
opposite side of the first from the second in the X or Y direction.
.IP "\fB:mpoint\fR \(em Move Point"
Replace a point within an element.
When you lay down a point
.B gremlin
uses it to replace the point that is closest to the one you laid down,
and redraws the shape to reflect this change.
.IP "\fB:msize \fIsize\fR \(em Modify Size"
Redraw in font
.I size
all text elements in the current set.
.IP "\fB:mtext \fIstring\fR \(em Modify Text"
Replace every text element in the current set with
.IR string .
.IP "\fB:orient\fR \(em Toggle Orientation"
Toggle screen orientation between horzontal and vertical.
.IP "\fB:path \fIstring\fR \(em Set Path"
Set the search path to
.IR string ,
which contains one or more directory names separated by colons.
You can use `~' to indicate your home directory.
Two colons `::' is  equivalent to `:.:' \(em that is, the current directory.
.IP
The search path names the directories that
.B gremlin
examines when it seeks files to open for reading.
If no directory in the path contains the file sought,
.B gremlin
attempts to read the file from its library.
.IP
If the file name begins with a `~' or `/',
.B gremlin
ignores the path, and searches only the appropriate directory \(em
respectively, your home directory or the file's the absolute path name.
.IP
If
.I string
is not specified,
.B gremlin
prints the current path.
.IP "\fB:point \fIX Y\fR \(em Place Point"
Place a point at coordinates
.I X
and
.I Y
in the picture area.
.IP "\fB:quit\fR \(em Quit"
Quit the edit session.
.IP "\fB:read \fIfile\fR \(em Read Picture File"
Read the symbol defined in
.I file
into the picture as the current set.  
.IP "\fB:saveset \fIfile\fR \(em Write the Current Set"
Write the current set into
.IR file .
.IP "\fB:showpoints\fR \(em Show Reference Points"
Display reference points of all elements in the current set.
.IP "\fB:size \fIn\fR \(em Select Size"
Set the size of the current font.
.I n
must be between one and four, with one the smallest and four the largest.
.IP "\fB:text \fIstring\fR \(em Insert Text"
Add
.I string
to the picture.
.B gremlin
justifies
.I string
on the point or points you set.
.IP "\fB:undo\fR \(em Undo Last Command"
Undo the effect of the previous command, even if it was an undo command.
.IP "\fB:vadjust\fR \(em Vertical Adjust"
Toggle vertical adjustment.
When on,
.B gremlin
forces each point to lie on the same vertical line
as the previous point.
This is useful when you want to draw a line that is straight vertically.
.IP "\fB:write \fIfile\fR \(em Write Edit File"
Write out the picture into a file.
If
.I file
is not specified,
.B gremlin
writes the picture into the current edit file.
.SH "See Also"
.B
X applications
.R
gprint(1)
.SH Notes
.II "Roitblat, Barry"
.II "Opperman, Mark"
.II "Chen, Yih-Farn"
.II "Thompson, Jim"
.B gremlin
was written by Barry Roitblat.
The original was written by Mark Opperman.
Modifications were made by Yih-Farn Chen (yfchen@monet.berkeley.edu)
and Jim Thompson (james@ernie.berkeley.edu).
Please mail gripes (and praise) to Jim Thompson.
