home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 700s / rfc746.txt < prev    next >
Text File  |  1992-10-14  |  30KB  |  885 lines

  1.  
  2. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  3. The SUPDUP Graphics Extension
  4.  
  5.  
  6.  
  7. Network Working Group                                   Richard Stallman
  8. Request for Comments 746                                          MIT-AI
  9. NIC 43976                                                  17 March 1978
  10.  
  11. The SUPDUP Graphics Extension
  12.  
  13.    ... extends SUPDUP to permit the display of drawings on the screen of
  14.    the terminal, as well as text.  We refer constantly to the
  15.    documentation of the SUPDUP protocol, described by Crispin in RFC 734
  16.    "SUPDUP Protocol".
  17.  
  18.    Since this extension has never been implemented, it presumably has
  19.    some problems.  It is being published to ask for suggestions, and to
  20.    encourage someone to try to bring it up.
  21.  
  22. The major accomplishments are these:
  23.  
  24.    *    It is easy to do simple things.
  25.  
  26.    *    Any program on the server host can at any time begin outputting
  27.         pictures.  No special preparations are needed.
  28.  
  29.    *    No additional network connections are needed.  Graphics commands
  30.         go through the normal text output connection.
  31.  
  32.    *    It has nothing really to do with the network.  It is suitable
  33.         for use with locally connected intelligent display terminals in
  34.         a terminal-independent manner, by programs which need not know
  35.         whether they are being used locally or remotely.  It can be used
  36.         as the universal means of expression of graphics output, for
  37.         whatever destination.  Programs can be written to use it for
  38.         non-network terminals, with little loss of convenience, and
  39.         automatically be usable over the ARPA network.
  40.  
  41.    *    Loss of output (due, perhaps, to a "silence" command typed by
  42.         the user) does not leave the user host confused.
  43.  
  44.    *    The terminal does not need to be able to remember the internal
  45.         "semantic" structure of the picture being displayed, but just
  46.         the lines and points, or even just bits in a bit matrix.
  47.  
  48.    *    The server host need not be able to invoke arbitrary
  49.         terminal-dependent software to convert a standard language into
  50.         one that a terminal can use.  Instead, a standard language is
  51.         defined which all programmable terminals can interpret easily.
  52.         Major differences between terminals are catered to by
  53.         conventions for including enough redundant information in the
  54.         output stream that all types of terminals will have the
  55.         necessary information available when it is needed, even if they
  56.  
  57.  
  58.  
  59.                                   -1-
  60.  
  61. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  62. The SUPDUP Graphics Extension
  63.  
  64.  
  65.  
  66.         are not able to remember it in usable form from one command to
  67.         another.
  68.  
  69. Those interested in network graphics should read about the Multics
  70. Graphics System, whose fundamental purpose is the same, but whose
  71. particular assumptions are very different (although it did inspire a few
  72. of the features of this proposal).
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.                                   -2-
  119.  
  120. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  121. The SUPDUP Graphics Extension
  122.  
  123.  
  124.  
  125. SUPDUP Initial Negotiation:
  126.  
  127.    One new optional variable, the SMARTS variable, is defined.  It
  128.    should follow the other variables sent by the SUPDUP user process to
  129.    the SUPDUP server process.  Bits and fields in the left half-word of
  130.    this variable are given names starting with "%TQ".  Bits and fields
  131.    in the right half are given names starting with "%TR".  Not all of
  132.    the SMARTS variable has to do with the graphics protocol, but most of
  133.    it does.  The %TQGRF bit should be 1 if the terminal supports
  134.    graphics output at all.
  135.  
  136. Invoking the Graphics Protocol:
  137.  
  138.    Graphics mode is entered by a %TDGRF (octal 231) code in the output
  139.    stream.  Following characters in the range 0 - 177 are interpreted
  140.    according to the graphics protocol.  Any character 200 or larger (a
  141.    %TD code) leaves graphics mode, and then has its normal
  142.    interpretation.  Thus, if the server forgets that the terminal in
  143.    graphics mode, the terminal will not long remain confused.
  144.  
  145.    Once in graphics mode, the output stream should contain a sequence of
  146.    graphics protocol commands, each followed by its arguments.  A zero
  147.    as a command is a no-op.  To leave graphics mode deliberately, it is
  148.    best to use a %TDNOP.
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.                                   -3-
  178.  
  179. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  180. The SUPDUP Graphics Extension
  181.  
  182.  
  183.  
  184. Co-ordinates:
  185.  
  186.    Graphics mode uses a cursor position which is remembered from one
  187.    graphics command to the next while in graphics mode.  The graphics
  188.    mode cursor is not the same one used by normal type-out:  Graphics
  189.    protocol commands have no effect on the normal type-out cursor, and
  190.    normal type-out has no effect on the graphics mode cursor.  In
  191.    addition, the graphics cursor's position is measured in dots rather
  192.    than in characters.  The relationship between the two units (dots,
  193.    and characters) is recorded by the %TQHGT and %TQWID fields of the
  194.    SMARTS variable of the terminal, which contain the height and width
  195.    in dots of the box occupied by a character.  The size of the screen
  196.    in either dimension is assumed to be the length of a character box
  197.    times the number of characters in that direction on the screen.  If
  198.    the screen is actually bigger than that, the excess is may or may not
  199.    be part of the visible area; the program will not know that it
  200.    exists, in any case.
  201.  
  202.    Each co-ordinate of the cursor position is a 14-bit signed number,
  203.    where zero is at the center of the screen (if the screen dimension is
  204.    an even number of dots, then the visible negative points extend one
  205.    unit farther that the positive ones, in proper two's complement
  206.    fashion).  Excessively large values of the co-ordinates will be off
  207.    the screen, but are still meaningful.
  208.  
  209.    An alternate mode is defined, which some terminals may support, in
  210.    which virtual co-ordinates are used.  The specified co-ordinates are
  211.    still 14-bit signed numbers, but instead of being in units of
  212.    physical dots on the terminal, it is assumed that +4000 octal is the
  213.    top of the screen or the right edge, while -4000 octal is the bottom
  214.    of the screen or the left edge.  The terminal is responsible for
  215.    scaling these virtual co-ordinates into units of screen dots.  Not
  216.    all terminals need have this capability; the %TQVIR bit in the SMARTS
  217.    variable indicates that it exists.  To use virtual co-ordinates, the
  218.    server should send a %GOVIR; to use physical co-ordinates again, it
  219.    should send a %GOPHY.  These should be repeated at intervals, such as
  220.    when graphics mode is entered, even though the terminal must attempt
  221.    to remember the state of the switch anyway.  This repetition is so
  222.    that a loss of some output will not cause unbounded confusion.
  223.  
  224.    The virtual co-ordinates are based on a square.  If the visible area
  225.    on the terminal is not a square, then the standard virtual range
  226.    should correspond to a square around the center of the screen, and
  227.    the rest of the visible area should correspond to virtual
  228.    co-ordinates just beyond the normally visible range.
  229.  
  230.    Graphics protocol commands take two types of cursor position
  231.    arguments, absolute ones and relative ones.  Commands that take
  232.    address arguments generally have two forms, one for each type of
  233.  
  234.  
  235.  
  236.                                   -4-
  237.  
  238. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  239. The SUPDUP Graphics Extension
  240.  
  241.  
  242.  
  243.    address.  A relative address consists of two offsets, delta-X and
  244.    delta-Y, from the old cursor position.  Each offset is a 7-bit two's
  245.    complement number occupying one character.  An absolute address
  246.    consists of two co-ordinates, each 14 bits long, occupying two
  247.    characters, each of which conveys 7 bits.  The X co-ordinate or
  248.    offset precedes the Y.  Both types of address set the running cursor
  249.    position which will be used by the next address, if it is relative.
  250.    It is perfectly legitimate for parts of objects to go off the screen.
  251.    What happens to them is not terribly important, as long as it is not
  252.    disastrous, does not interfere with the reckoning of the cursor
  253.    position, and does not cause later objects, drawn after the cursor
  254.    moves back onto the screen, to be misdrawn.
  255.  
  256.    Whether a particular spot on the screen is specified with an absolute
  257.    or a relative address is of no consequence.  The sequence in which
  258.    they are drawn is of no consequence.  Each object is independent of
  259.    all others, and exists at the place which was specified, in one way
  260.    or other, by the command that created it.  Relative addresses are
  261.    provided for the sake of data compression.  They are not an attempt
  262.    to spare programs the need for the meagre intelligence required to
  263.    convert between absolute and relative addresses; more intelligence
  264.    than that will surely be required for other aspects of the graphics
  265.    protocol.  Nor are relative addresses intended to cause several
  266.    objects to relocate together if one is "moved" or erased.  Terminals
  267.    are not expected to remember any relation between objects once they
  268.    are drawn.  Most will not be able to.
  269.  
  270.    Although the cursor position on entry to graphics mode remains set
  271.    from the last exit, it is wise to reinitialize it with a %GOMVA
  272.    command before any long transfer, to limit the effects of lost
  273.    output.
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.                                   -5-
  296.  
  297. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  298. The SUPDUP Graphics Extension
  299.  
  300.  
  301.  
  302. Commands:
  303.  
  304.    Commands to draw an object always have counterparts which erase the
  305.    same object.  On a bit matrix terminal, erasure and drawing are
  306.    almost identical operations.  On a display list terminal, erasure
  307.    involves searching the display list for an object with the specified
  308.    characteristics and deleting it from the list.  It is assumed that
  309.    any terminal whose %TOERS bit is set can erase graphic objects.
  310.  
  311.    The commands to draw objects run from 100 to 137, while those to
  312.    erase run in a parallel sequence from 140 to 177.  Other sorts of
  313.    operations have command codes below 100.  Meanwhile, the 20 bit in
  314.    the command code says which type of addresses are used as arguments:
  315.    if the 20 bit is set, absolute addresses are used.  Graphics commands
  316.    are given names starting with "%GO".
  317.  
  318.    Graphics often uses characters.  The %GODCH command is followed by a
  319.    string of characters to be output, terminated by a zero.  The
  320.    characters must be single-position printing characters.  On most
  321.    terminals, this limits them to ASCII graphic characters.  Terminals
  322.    with %TOSAI set in the TTYOPT variable allow all characters 0-177.
  323.    The characters are output at the current graphics cursor position
  324.    (the lower left hand corner of the first character's rectangle being
  325.    placed there), which is moved as the characters are drawn.  The
  326.    normal type-out cursor is not relevant and its position is not
  327.    changed.  The cursor position at which the characters are drawn may
  328.    be in between the lines and columns used for normal type-out.  The
  329.    %GOECH command is similar to %GODCH but erases the characters
  330.    specified in it.  To clear out a row of character positions on a bit
  331.    matrix terminal without having to respecify the text, a rectangle
  332.    command may be used.
  333.  
  334.    Example:
  335.  
  336.       The way to send a simple line drawing is this:
  337.  
  338.          %TDRST                 ;Reset all graphics modes.
  339.          %TDGRF                 ;Enter graphics.
  340.          %GOCLR                 ;Clear the screen.
  341.          %GOMVA xx yy           ;Set cursor.
  342.          %GODLA xx yy           ;Draw line from there.
  343.          << repeat last two commands for each line >>
  344.          %TDNOP                 ;Exit graphics.
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.                                   -6-
  355.  
  356. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  357. The SUPDUP Graphics Extension
  358.  
  359.  
  360.  
  361. Graphics Input:
  362.  
  363.    The %TRGIN bit in the right half of the SMARTS variable indicates
  364.    that the terminal can supply a graphic input in the form of a cursor
  365.    position on request.  Sending a %GOGIN command to the terminal asks
  366.    to read the cursor position.  It should be followed by an argument
  367.    character that will be included in the reply, and serve to associate
  368.    the reply with the particular request for input that elicited it.
  369.    The reply should have the form of a Top-Y character (code 4131),
  370.    followed by the reply code character as just described, followed by
  371.    an absolute cursor position.  Since Top-Y is not normally meaningful
  372.    as input, %GOGIN replies can be distinguished reliably from keyboard
  373.    input. Unsolicited graphic input should be sent using a Top-X instead
  374.    of a Top-Y, so that the program can distinguish them.  Instead of a
  375.    reply code, for which there is no need, the terminal should send an
  376.    encoding of the buttons pressed by the user on his input device, if
  377.    it has more than one.
  378.  
  379. Sets:
  380.  
  381.    Terminals may define the concept of a "set" of objects.  There are up
  382.    to 200 different sets, each of which can contain arbitrarily many
  383.    objects.  At any time, one set is selected; objects drawn become part
  384.    of that set, and objects erased are removed from it.  Objects in a
  385.    set other than the selected one cannot be erased without switching to
  386.    the sets that contain them.  A set can be made temporarily invisible,
  387.    as a whole, without being erased or its contents forgotten; and it
  388.    can then be made instantly visible again.  Also, a whole set can be
  389.    moved.  A set has at all times a point identified as its "center",
  390.    and all objects in it are actually remembered relative to that
  391.    center, which can be moved arbitrarily, thus moving all the objects
  392.    in the set at once.  Before beginning to use a set, therefore, one
  393.    should "move" its center to some absolute location.  Set center
  394.    motion can easily cause objects in the set to move off screen.  When
  395.    this happens, it does not matter what happens temporarily to those
  396.    objects, but their "positions" must not be forgotten, so that undoing
  397.    the set center motion will restore them to visibility in their
  398.    previous positions.  Sets are not easily implemented on bit matrix
  399.    terminals, which should therefore ignore all set operations (except,
  400.    for a degenerate interpretation in connection with blinking, if that
  401.    is implemented).  The %TQSET bit in the SMARTS variable of the
  402.    terminal indicates that the terminal implements multiple sets of
  403.    objects.
  404.  
  405.    On a terminal which supports multiple sets, the %GOCLR command should
  406.    empty all sets and mark all sets "visible" (perform a %GOVIS on each
  407.    one).  So should a %TDCLR SUPDUP command.  Thus, any program which
  408.    starts by clearing the screen will not have to worry about
  409.    initializing the states of all sets.
  410.  
  411.  
  412.  
  413.                                   -7-
  414.  
  415. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  416. The SUPDUP Graphics Extension
  417.  
  418.  
  419.  
  420. Blinking:
  421.  
  422.    Some terminals have the ability to blink objects on the screen. The
  423.    command %GOBNK meaning make the current set blink.  All objects in it
  424.    already begin blinking, and any new objects also blink.  %GOVIS or
  425.    %TOINV cancels the effect of a %GOBNK, making the objects of the set
  426.    permanently visible or invisible.  %TQBNK indicates that the terminal
  427.    supports blinking on the screen.
  428.  
  429.    However, there is a problem:  some intelligent bit matrix terminals
  430.    may be able to implement blinking a few objects, if they are told in
  431.    advance, before the objects are drawn.  They will be unable to
  432.    support arbitrary use of %GOBNK, however.
  433.  
  434.    The solution to the problem is a convention for the use of %TOBNK
  435.    which, together with degenerate definitions for set operations, makes
  436.    it possible to give commands which reliably work on any terminal
  437.    which supports blinking.
  438.  
  439.    On a terminal which sets %TQBNK but not %TQSET, %GOBNK is defined to
  440.    cause objects which are drawn after it to be drawn blinking. %GOSET
  441.    cancels this, so following objects will be drawn unblinking. This is
  442.    regardless of the argument to the %GOSET.
  443.  
  444.    Thus, the way for a program to work on all terminals with %TQBNK,
  445.    whether they know about sets or not, is:  to write a bliniking
  446.    picture, select some set other than your normal one (set 1 will do),
  447.    do %GOBNK, output the picture, and reselect set 0.  The picture will
  448.    blink, while you draw things in set 0.  To draw more blinking
  449.    objects, you must reselect set 1 and do another %GOBNK.  Simply
  450.    reselecting set 1 will not work on terminals which don't really
  451.    support sets, since they don't remember that the blinking objects are
  452.    "in set 1" and not "in set 0".
  453.  
  454.    Erasing a blinking object should make it disappear, on any terminal
  455.    which implements blinking.  On bit matrix terminals, blinking MUST
  456.    always be done by XORing, so that the non-blinking background is not
  457.    destroyed.
  458.  
  459.    %GOCLS, on a terminal which supports blinking but not sets, should
  460.    delete all blinking objects.  Then, the convention for deleting all
  461.    blinking objects is to select set 1, do a %GOCLS, and reselect set 0.
  462.    This has the desired effect on all terminals.  This definition of
  463.    %GOCLS causes no trouble on non-set terminals, since %GOCLS would
  464.    otherwise be meaningless to them.
  465.  
  466.    To make blinking objects stop blinking but remain visible is possible
  467.    with a %GOVIS on a terminal which supports sets.  But in general the
  468.    only way to do it is to delete them and redraw them as permanent.
  469.  
  470.  
  471.  
  472.                                   -8-
  473.  
  474. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  475. The SUPDUP Graphics Extension
  476.  
  477.  
  478.  
  479. Rectangles and XOR
  480.  
  481.    Bit matrix terminals have their own operations that display list
  482.    terminals cannot duplicate.  First of all, they have XOR mode, in
  483.    which objects drawn cancel existing objects when they overlap.  In
  484.    this mode, drawing an object and erasing it are identical operations.
  485.    All %GOD.. commands act IDENTICALLY to the corresponding %GOE..'s.
  486.    XOR mode is entered with a %GOXOR and left with a %GOIOR.  Display
  487.    list terminals will ignore both commands.  For that reason, the
  488.    program should continue to distinguish draw commands from erase
  489.    commands even in XOR mode.  %TQXOR indicates a terminal which
  490.    implements XOR mode.  XOR mode, when set, remains set even if
  491.    graphics mode is left and re-entered.  However, it is wise to
  492.    re-specify it from time to time, in case output is lost.
  493.  
  494.    Bit matrix terminals can also draw solid rectangles.  They can thus
  495.    implement the commands %GODRR, %GODRA, %GOERR, and %GOERA.  A
  496.    rectangle is specified by taking the current cursor position to be
  497.    one corner, and providing the address of the opposite corner.  That
  498.    can be done with either a relative address or an absolute one.  The
  499.    %TQREC bit indicates that the terminal implements rectangle commands.
  500.  
  501.    Of course, a sufficiently intelligent bit matrix terminal can provide
  502.    all the features of a display list terminal by remembering display
  503.    lists which are redundant with the bit matrix, and using them to
  504.    update the matrix when a %GOMSR or %GOVIS is done.  However, most bit
  505.    matrix terminals are not expected to go to such lengths.
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.                                   -9-
  532.  
  533. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  534. The SUPDUP Graphics Extension
  535.  
  536.  
  537.  
  538. How Several Process Can Draw On One Terminal Without Interfering With
  539. Each Other:
  540.  
  541.    If we define "input-stream state" information to be whatever
  542.    information which can affect the action of any command, other than
  543.    what is contained in the command, then each of the several processes
  544.    must have its own set of input-stream state variables.
  545.  
  546.    This is accomplished by providing the %GOPSH command.  The %GOPSH
  547.    command saves all such input-stream information, to be restored when
  548.    graphics mode is exited.  If the processes can arrange to output
  549.    blocks of characters uninterruptibly, they can begin each block with
  550.    a %GOPSH followed by commands to initialize the input-stream state
  551.    information as they desire.  Each block of graphics output should be
  552.    ended by a %TDNOP, leaving the terminal in its "normal" state for all
  553.    the other processes, and at the same time popping the what the %GOPSH
  554.    pushed.
  555.  
  556.       The input-stream state information consists of:
  557.  
  558.          The cursor position
  559.          the state of XOR mode (default is OFF)
  560.          the selected set (default is 0)
  561.          the co-ordinate unit in use (physical dots, or virtual)
  562.             (default is physical)
  563.          whether output is going to the display screen or to a hardcopy
  564.             device (default is to the screen)
  565.          what portion of the screen is in use
  566.             (see "Using Only Part of the Screen")
  567.             (default is all)
  568.  
  569.    Each unit of input-stream status has a default value for the sake of
  570.    programs that do not know that the information exists; the exception
  571.    is the cursor position, since all programs must know that it exists.
  572.    A %TDINI or %TDRST command should set all of the variables to their
  573.    default values.
  574.  
  575.    The state of the current set (whether it is visible, and where its
  576.    center is) is not part of the input-stream state information, since
  577.    it would be hard to say what it would mean if it were.  Besides, the
  578.    current set number is part of the input-stream state information, so
  579.    different processes can use different sets.  The allocation of sets
  580.    to processes is the server host's own business.
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                                   -10-
  591.  
  592. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  593. The SUPDUP Graphics Extension
  594.  
  595.  
  596.  
  597. Using Only Part of the Screen:
  598.  
  599.    It is sometimes desirable to use part of the screen for picture and
  600.    part for text.  Then one may wish to clear the picture without
  601.    clearing the text.  On display list terminals, %GOCLR should do this.
  602.    On bit matrix terminals, however, %GOCLR can't tell which bits were
  603.    set by graphics and which by text display.  For their sake, the
  604.    %GOLMT command is provided.  This command takes two cursor positions
  605.    as arguments, specifying a rectangle.  It declares that graphics will
  606.    be limited to that rectangle, so %GOCLR should clear only that part
  607.    of the screen.  %GOLMT need not do anything on a terminal which can
  608.    remember graphics output as distinct from text output and clear the
  609.    former selectively, although it would be a desirable feature to
  610.    process it even on those terminals.
  611.  
  612.    %GOLMT can be used to enable one of several processes which divide up
  613.    the screen among themselves to clear only the picture that it has
  614.    drawn, on a bit matrix terminal.  By using both %GOLMT and distinct
  615.    sets, it is possible to deal successfully with almost any terminal,
  616.    since bit matrix terminals will implement %GOLMT and display list
  617.    terminals almost always implement sets.
  618.  
  619.    The %TDCLR command should clear the whole screen, including graphics
  620.    output, ignoring %GOLMT.
  621.  
  622. Errors:
  623.  
  624.    In general, errors in graphics commands should be ignored.
  625.  
  626.    Since the output and input streams are not synchronized unless
  627.    trouble is taken, there is no simple way to report an error well
  628.    enough for the program that caused it to identify just which command
  629.    was invalid.  So it is better not to try.
  630.  
  631.    Errors which are not the fault of any individual command, such as
  632.    running out of memory for display lists, should also be ignored as
  633.    much as possible.  This does NOT mean completely ignoring the
  634.    commands that cannot be followed; it means following them as much as
  635.    possible: moving the cursor, selecting sets, etc. as they specify, so
  636.    that any subsequent commands which can be executed are executed as
  637.    intended.
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.                                   -11-
  650.  
  651. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  652. The SUPDUP Graphics Extension
  653.  
  654.  
  655.  
  656. Extensions:
  657.  
  658.    This protocol does not attempt to specify commands for dealing with
  659.    every imaginable feature which a picture-drawing device can have.
  660.    Additional features should be left until they are needed and well
  661.    understood, so that they can be done right.
  662.  
  663. Storage of Graphics Commands in Files:
  664.  
  665.    This can certainly be done.  Since graphics commands are composed
  666.    exclusively of the ASCII characters 0 - 177, any file that can hold
  667.    ASCII text can hold the commands to draw a picture.  This is less
  668.    useful than you might think, however.  Any program for editing, in
  669.    whatever loose sense, a picture, will have its own internal data
  670.    which determine the relationships between the objects depicted, and
  671.    control the interpretation of the programs commands, and this data
  672.    will all be lost in the SUPDUP graphics commands for displaying the
  673.    picture. Thus, each such program will need to have its own format for
  674.    storing pictures in files, suitable for that program's internal data
  675.    structure.  Inclusion of actual graphics commands in a file will be
  676.    useful only when the sole purpose of the file is to be displayed.
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.                                   -12-
  709.  
  710. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  711. The SUPDUP Graphics Extension
  712.  
  713.  
  714.  
  715. Note: the values of these commands are represented as 8.-bit octal
  716. bytes.  Arguments to the commands are in lower case inside angle
  717. brackets.
  718.  
  719. The Draw commands are:
  720.  
  721. Value   Name   Arguments
  722.  
  723. 101     %GODLR <p>
  724.                 Draw line relative, from the cursor to <p>.
  725. 102     %GODPR <p>
  726.                 Draw point relative, at <p>.
  727. 103     %GODRR <p>
  728.                 Draw rectangle relative, corners at <p> and at the
  729.                 current cursor position.
  730. 104     %GODCH <string> <0>
  731.                 Display the chars of <string> starting at the current
  732.                 graphics cursor position.
  733. 121     %GODLA <p>
  734.                 Draw line absolute, from the cursor to <p>. The same
  735.                 effect as %GODLR, but the arg is an absolute address.
  736. 122     %GODPA <p>
  737.                 Draw point absolute, at <p>.
  738. 123     %GODRA <p>
  739.                 Draw rectangle absolute, corners at <p> and at the
  740.                 current cursor position.
  741.  
  742. The Erase commands are:
  743.  
  744. Value   Name   Arguments
  745.  
  746. 141     %GOELR <p>
  747.                 Erase line relative, from the cursor to <p>.
  748. 142     %GOEPR <p>
  749.                 Erase point relative, at <p>.
  750. 143     %GOERR <p>
  751.                 Erase rectangle relative, corners at <p> and at the
  752.                 current cursor position.
  753. 144     %GOECH <string> <0>
  754.                 Erase the chars of <string> starting at the current
  755.                 graphics cursor position.
  756. 161     %GOELA <p>
  757.                 Erase line absolute, from the cursor to <p>.
  758. 162     %GOEPA <p>
  759.                 Erase point absolute, at <p>.
  760. 163     %GOERA <p>
  761.                 Erase rectangle absolute, corners at <p> and at the
  762.                 current cursor position.
  763.  
  764.  
  765.  
  766.  
  767.                                   -13-
  768.  
  769. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  770. The SUPDUP Graphics Extension
  771.  
  772.  
  773.  
  774. The miscellaneous commands are:
  775.  
  776. Value   Name   Arguments
  777.  
  778. 001     %GOMVR <p>
  779.                 Move cursor to point <p>
  780. 021     %GOMVA <p>
  781.                 Move cursor to point <p>, absolute address.
  782. 002     %GOXOR
  783.                 Turn on XOR mode.  Bit matrix terminals only.
  784. 022     %GOIOR
  785.                 Turn off XOR mode.
  786. 003     %GOSET <n>
  787.                 Select set.  <n> is a 1-character set number, 0 - 177.
  788. 004     %GOMSR <p>
  789.                 Move set origin to <p>.  Display list terminals only.
  790. 024     %GOMSA <p>
  791.                 Move set origin to <p>, absolute address.
  792. 006     %GOINV
  793.                 Make current set invisible.
  794. 026     %GOVIS
  795.                 Make current set visible.
  796. 007     %GOBNK
  797.                 Make current set blink.  Canceled by %GOINV or %GOVIS.
  798. 010     %GOCLR
  799.                 Erase whole screen.
  800. 030     %GOCLS
  801.                 Erase entire current set (display list terminals).
  802. 011     %GOPSH
  803.                 Push all input-stream status information, to be restored
  804.                 when graphics mode is exited.
  805. 012     %GOVIR
  806.                 Start using virtual co-ordinates
  807. 032     %GOPHY
  808.                 Resume giving co-ordinates in units of dots.
  809. 013     %GOHRD <n>
  810.                 Divert output to output subdevice <n>. <n>=0 reselects
  811.                 the main display screen.
  812. 014     %GOGIN <n>
  813.                 Request graphics input (mouse, tablet, etc). <n> is the
  814.                 reply code to include in the answer.
  815. 015     %GOLMT <p1> <p2>
  816.                 Limits graphics to a subrectangle of the screen. %GOCLR
  817.                 will clear only that area.  This is for those who would
  818.                 use the rest for text.
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.                                   -14-
  827.  
  828. NWG/RFC# 746                                         RMS 17-MAR-78 43976
  829. The SUPDUP Graphics Extension
  830.  
  831.  
  832.  
  833. Bits in the SMARTS Variable Related to Graphics:
  834.  
  835. Note: the values of these bits are represented as octal 36.-bit words,
  836. with the left and right 18.-bit halfword separated by two commas as in
  837. the normal PDP-10 convention.
  838.  
  839. Name    Value      Description
  840.  
  841. %TQGRF  000001,,0  terminal understands graphics protocol.
  842.  
  843. %TQSET  000002,,0  terminal supports multiple sets.
  844.  
  845. %TQREC  000004,,0  terminal implements rectangle commands.
  846.  
  847. %TQXOR  000010,,0  terminal implements XOR mode.
  848.  
  849. %TQBNK  000020,,0  terminal implements blinking.
  850.  
  851. %TQVIR  000040,,0  terminal implements virtual co-ordinates.
  852.  
  853. %TQWID  001700,,0  character width, in dots.
  854.  
  855. %TQHGT  076000,,0  character height, in dots.
  856.  
  857. %TRGIN  0,,400000  terminal can provide graphics input.
  858.  
  859. %TRGHC  0,,200000  terminal has a hard-copy device to which output can
  860.                    be diverted.
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.                                   -15-