rfc746.txt
来自「RFC 的详细文档!」· 文本 代码 · 共 885 行 · 第 1/3 页
TXT
885 行
NWG/RFC# 746 RMS 17-MAR-78 43976
The SUPDUP Graphics Extension
Commands:
Commands to draw an object always have counterparts which erase the
same object. On a bit matrix terminal, erasure and drawing are
almost identical operations. On a display list terminal, erasure
involves searching the display list for an object with the specified
characteristics and deleting it from the list. It is assumed that
any terminal whose %TOERS bit is set can erase graphic objects.
The commands to draw objects run from 100 to 137, while those to
erase run in a parallel sequence from 140 to 177. Other sorts of
operations have command codes below 100. Meanwhile, the 20 bit in
the command code says which type of addresses are used as arguments:
if the 20 bit is set, absolute addresses are used. Graphics commands
are given names starting with "%GO".
Graphics often uses characters. The %GODCH command is followed by a
string of characters to be output, terminated by a zero. The
characters must be single-position printing characters. On most
terminals, this limits them to ASCII graphic characters. Terminals
with %TOSAI set in the TTYOPT variable allow all characters 0-177.
The characters are output at the current graphics cursor position
(the lower left hand corner of the first character's rectangle being
placed there), which is moved as the characters are drawn. The
normal type-out cursor is not relevant and its position is not
changed. The cursor position at which the characters are drawn may
be in between the lines and columns used for normal type-out. The
%GOECH command is similar to %GODCH but erases the characters
specified in it. To clear out a row of character positions on a bit
matrix terminal without having to respecify the text, a rectangle
command may be used.
Example:
The way to send a simple line drawing is this:
%TDRST ;Reset all graphics modes.
%TDGRF ;Enter graphics.
%GOCLR ;Clear the screen.
%GOMVA xx yy ;Set cursor.
%GODLA xx yy ;Draw line from there.
<< repeat last two commands for each line >>
%TDNOP ;Exit graphics.
-6-
NWG/RFC# 746 RMS 17-MAR-78 43976
The SUPDUP Graphics Extension
Graphics Input:
The %TRGIN bit in the right half of the SMARTS variable indicates
that the terminal can supply a graphic input in the form of a cursor
position on request. Sending a %GOGIN command to the terminal asks
to read the cursor position. It should be followed by an argument
character that will be included in the reply, and serve to associate
the reply with the particular request for input that elicited it.
The reply should have the form of a Top-Y character (code 4131),
followed by the reply code character as just described, followed by
an absolute cursor position. Since Top-Y is not normally meaningful
as input, %GOGIN replies can be distinguished reliably from keyboard
input. Unsolicited graphic input should be sent using a Top-X instead
of a Top-Y, so that the program can distinguish them. Instead of a
reply code, for which there is no need, the terminal should send an
encoding of the buttons pressed by the user on his input device, if
it has more than one.
Sets:
Terminals may define the concept of a "set" of objects. There are up
to 200 different sets, each of which can contain arbitrarily many
objects. At any time, one set is selected; objects drawn become part
of that set, and objects erased are removed from it. Objects in a
set other than the selected one cannot be erased without switching to
the sets that contain them. A set can be made temporarily invisible,
as a whole, without being erased or its contents forgotten; and it
can then be made instantly visible again. Also, a whole set can be
moved. A set has at all times a point identified as its "center",
and all objects in it are actually remembered relative to that
center, which can be moved arbitrarily, thus moving all the objects
in the set at once. Before beginning to use a set, therefore, one
should "move" its center to some absolute location. Set center
motion can easily cause objects in the set to move off screen. When
this happens, it does not matter what happens temporarily to those
objects, but their "positions" must not be forgotten, so that undoing
the set center motion will restore them to visibility in their
previous positions. Sets are not easily implemented on bit matrix
terminals, which should therefore ignore all set operations (except,
for a degenerate interpretation in connection with blinking, if that
is implemented). The %TQSET bit in the SMARTS variable of the
terminal indicates that the terminal implements multiple sets of
objects.
On a terminal which supports multiple sets, the %GOCLR command should
empty all sets and mark all sets "visible" (perform a %GOVIS on each
one). So should a %TDCLR SUPDUP command. Thus, any program which
starts by clearing the screen will not have to worry about
initializing the states of all sets.
-7-
NWG/RFC# 746 RMS 17-MAR-78 43976
The SUPDUP Graphics Extension
Blinking:
Some terminals have the ability to blink objects on the screen. The
command %GOBNK meaning make the current set blink. All objects in it
already begin blinking, and any new objects also blink. %GOVIS or
%TOINV cancels the effect of a %GOBNK, making the objects of the set
permanently visible or invisible. %TQBNK indicates that the terminal
supports blinking on the screen.
However, there is a problem: some intelligent bit matrix terminals
may be able to implement blinking a few objects, if they are told in
advance, before the objects are drawn. They will be unable to
support arbitrary use of %GOBNK, however.
The solution to the problem is a convention for the use of %TOBNK
which, together with degenerate definitions for set operations, makes
it possible to give commands which reliably work on any terminal
which supports blinking.
On a terminal which sets %TQBNK but not %TQSET, %GOBNK is defined to
cause objects which are drawn after it to be drawn blinking. %GOSET
cancels this, so following objects will be drawn unblinking. This is
regardless of the argument to the %GOSET.
Thus, the way for a program to work on all terminals with %TQBNK,
whether they know about sets or not, is: to write a bliniking
picture, select some set other than your normal one (set 1 will do),
do %GOBNK, output the picture, and reselect set 0. The picture will
blink, while you draw things in set 0. To draw more blinking
objects, you must reselect set 1 and do another %GOBNK. Simply
reselecting set 1 will not work on terminals which don't really
support sets, since they don't remember that the blinking objects are
"in set 1" and not "in set 0".
Erasing a blinking object should make it disappear, on any terminal
which implements blinking. On bit matrix terminals, blinking MUST
always be done by XORing, so that the non-blinking background is not
destroyed.
%GOCLS, on a terminal which supports blinking but not sets, should
delete all blinking objects. Then, the convention for deleting all
blinking objects is to select set 1, do a %GOCLS, and reselect set 0.
This has the desired effect on all terminals. This definition of
%GOCLS causes no trouble on non-set terminals, since %GOCLS would
otherwise be meaningless to them.
To make blinking objects stop blinking but remain visible is possible
with a %GOVIS on a terminal which supports sets. But in general the
only way to do it is to delete them and redraw them as permanent.
-8-
NWG/RFC# 746 RMS 17-MAR-78 43976
The SUPDUP Graphics Extension
Rectangles and XOR
Bit matrix terminals have their own operations that display list
terminals cannot duplicate. First of all, they have XOR mode, in
which objects drawn cancel existing objects when they overlap. In
this mode, drawing an object and erasing it are identical operations.
All %GOD.. commands act IDENTICALLY to the corresponding %GOE..'s.
XOR mode is entered with a %GOXOR and left with a %GOIOR. Display
list terminals will ignore both commands. For that reason, the
program should continue to distinguish draw commands from erase
commands even in XOR mode. %TQXOR indicates a terminal which
implements XOR mode. XOR mode, when set, remains set even if
graphics mode is left and re-entered. However, it is wise to
re-specify it from time to time, in case output is lost.
Bit matrix terminals can also draw solid rectangles. They can thus
implement the commands %GODRR, %GODRA, %GOERR, and %GOERA. A
rectangle is specified by taking the current cursor position to be
one corner, and providing the address of the opposite corner. That
can be done with either a relative address or an absolute one. The
%TQREC bit indicates that the terminal implements rectangle commands.
Of course, a sufficiently intelligent bit matrix terminal can provide
all the features of a display list terminal by remembering display
lists which are redundant with the bit matrix, and using them to
update the matrix when a %GOMSR or %GOVIS is done. However, most bit
matrix terminals are not expected to go to such lengths.
-9-
NWG/RFC# 746 RMS 17-MAR-78 43976
The SUPDUP Graphics Extension
How Several Process Can Draw On One Terminal Without Interfering With
Each Other:
If we define "input-stream state" information to be whatever
information which can affect the action of any command, other than
what is contained in the command, then each of the several processes
must have its own set of input-stream state variables.
This is accomplished by providing the %GOPSH command. The %GOPSH
command saves all such input-stream information, to be restored when
graphics mode is exited. If the processes can arrange to output
blocks of characters uninterruptibly, they can begin each block with
a %GOPSH followed by commands to initialize the input-stream state
information as they desire. Each block of graphics output should be
ended by a %TDNOP, leaving the terminal in its "normal" state for all
the other processes, and at the same time popping the what the %GOPSH
pushed.
The input-stream state information consists of:
The cursor position
the state of XOR mode (default is OFF)
the selected set (default is 0)
the co-ordinate unit in use (physical dots, or virtual)
(default is physical)
whether output is going to the display screen or to a hardcopy
device (default is to the screen)
what portion of the screen is in use
(see "Using Only Part of the Screen")
(default is all)
Each unit of input-stream status has a default value for the sake of
programs that do not know that the information exists; the exception
is the cursor position, since all programs must know that it exists.
A %TDINI or %TDRST command should set all of the variables to their
default values.
The state of the current set (whether it is visible, and where its
center is) is not part of the input-stream state information, since
it would be hard to say what it would mean if it were. Besides, the
current set number is part of the input-stream state information, so
different processes can use different sets. The allocation of sets
to processes is the server host's own business.
-10-
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?