home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff274.lzh / Snap / snap.doc < prev    next >
Text File  |  1989-11-16  |  15KB  |  406 lines

  1.                      Snap 1.3
  2.                      ========
  3.                © Mikael Karlsson 1989
  4.       Keymap inverting courtesy of Jim Mackraz
  5.  
  6.  
  7. Is it Public Domain?
  8.  
  9.   Snap is NOT Public Domain. Snap is 'Freely distributable
  10.   copyrighted software with a shareware option'.
  11.  
  12.   "Permission is hereby granted to copy Snap provided that
  13.    the copyright notice and this document is left intact.
  14.    Copies may not be made for profit."
  15.  
  16.   I don't know if the above should hold in court but what
  17.   I mean is: Copy Snap if you want to but don't make a
  18.   business of it. It is of course free to include it on
  19.   public domain disks or putting it on a BBS.
  20.   If you find Snap useful, please feel free to send a
  21.   donation ($10 is a nice round number) or a nice program (PD).
  22.   Or you can buy me a beer or two when we meet.
  23.   If you wish to include Snap with a commercial product,
  24.   please contact me first. I just want to make sure that
  25.   my ego can stand for it. Of course it would also be nice
  26.   with a registred copy of the product.
  27.   (How about including it with a '030 card?)
  28.  
  29.   Also read this message that Jim Mackraz sent to me regarding
  30.   some code used in Snap:
  31.  
  32.   "You may use ikm.c in your product Snap.
  33.    You may not distribute the source to ikm.c for profit,
  34.    and any distribution of ikm.c must retain the original
  35.    copyright message.
  36.  
  37.    You should also be warned that IKM() has not been
  38.    substantially verified in either design or implementation,
  39.    and that it will be made obsolete in version V1.4 by a
  40.    new OS function call.
  41.  
  42.    There is no explicit or implied guarantee that ikm.c contains
  43.    only supported algorithms.  It may have problems in a future
  44.    release of the system.
  45.  
  46.       jimm
  47.  
  48.    Jim Mackraz
  49.    Aug 18, 1989"
  50.  
  51.  
  52. What is it?
  53.  
  54.   Snap is the perfect tool for the lazy typer. Isn't it
  55.   irritating when you look at something on the screen
  56.   and think: "That is what I'm going to type."?
  57.   What if you could just point at it and get the computer to
  58.   type it for you? That's where Snap comes to the rescue.
  59.   Another thing that irritates me is that I'm sitting in
  60.   front of THE computer and still I must have pen and
  61.   paper available to scribble down something from the screen
  62.   that I know I will need later. Snap provides a solution
  63.   to that problem also. Just frame it and Snap creates a
  64.   window with a copy of the screen contents. Perfect for
  65.   snapping text from later on. This is another idea borrowed
  66.   from the computer scientists at Xerox Palo Alto Research
  67.   Center (you know, the ones who invented the mouse, windows,
  68.   icons and stuff like that).
  69.  
  70.  
  71. Why use Snap instead?
  72.  
  73.    a. Snap finds out the character coordinates automatically.
  74.    b. Snap uses the RastPort's current font, not just Topaz 8.
  75.    c. Snap was written by me.
  76.    d. Snap supports all fixed width fonts with width and height<16.
  77.    e. Snap supports accented characters (128-255).
  78.    f. Snap supports keymaps, thanks to Jim Mackraz.
  79.    g. Snap does both column and text oriented snapping.
  80.    h. Snap snaps graphics.
  81.    i. Snap uses the clipboard, making it compatible with TxED (and NotePad).
  82.    j. Snap understands inverted characters.
  83.    k. Snap understands bold characters.
  84.    l. Snap does word oriented snapping.
  85.    m. Snap has ants.
  86.    n. Snap has a key combination to do insert.
  87.    o. Snap supports Xerox style snapping with immediate insert.
  88.  
  89.  
  90. Starting and Stopping
  91.  
  92.    Start Snap with 'snap'. That's it. Snap detaches itself
  93.    from the CLI, making it possible to close the CLI.
  94.    Make sure that you have 'clipboard.device' in devs:.
  95.    To get rid of Snap, execute Snap again.
  96.    Note that you can't remove Snap if you have any 'snapped'
  97.    windows left.
  98.    Snap accepts a couple of command line arguments.
  99.    XX is hex. NN is decimal.
  100.      -pNN    where NN is the priority to use when installing
  101.              the input handler. Default is 51.
  102.      -tXX    where XX is the text qualifier to use in text
  103.              operations. Default is the left Amiga key.
  104.      -gXX    where XX is the graphics qualifier to use in
  105.              graphics operations. Default is the right Amiga key.
  106.      -iXX    where XX is the raw key code for the key to be used
  107.              together with the left Amiga key as insert key.
  108.              Use 0 to disable. Default is 17 ("I").
  109.      -cNN    where NN is the amount of time that Snap should
  110.              wait after each character inserted into the input
  111.              stream. Default is 0.
  112.      -lNN    where NN is the amount of time that Snap should
  113.              wait after each carriage return inserted into the
  114.              input stream. Default is 0.
  115.      -aXXXX  where XXXX is a 16 bit number that specifies the
  116.              pattern for the crawling ants. Use FFFF to turn
  117.              the crawling off. Default is 7777.
  118.      -x      tells Snap to use Xerox style snapping instead.
  119.              The snapped text is inserted immediately it has
  120.              been snapped.
  121.      -uN     tells Snap which unit to use when you start snapping.
  122.              0 is rectangular snapping (FRAME).
  123.              1 is character snapping (CHAR). Default is 0.
  124.      -bXX    where XX is the bit plane mask used when drawing the
  125.              selection frame for character snapping. This does not
  126.              affect graphics snapping. Default is 1.
  127.  
  128. QUALIFIERS (always entered in HEX)  (This list borrowed from Matt Dillon)
  129.  
  130.     0001    Left Shift
  131.     0002    Right Shift
  132.     0004    Caps Lock
  133.     0008    Control
  134.     0010    Left Alt
  135.     0020    Right Alt
  136.     0040    Left Amiga Key
  137.     0080    Right Amiga Key
  138.     0100    Numeric Key Pad Key (not useful)
  139.     0200    Repeat              (not useful)
  140.     0400    Interrupt           (not useful)
  141.     0800    Multibroadcast      (not useful)
  142.     1000    Middle Mouse Button (not normally implemented by intuition)
  143.     2000    Right Mouse Button
  144.     4000    Left Mouse Button
  145.  
  146.     Note: Combinations are allowed, in which case any one of the
  147.           elected qualifiers along with the left, right mouse button
  148.           will cause the appropriate action to occur.
  149.  
  150.    Some useful raw key codes:
  151.     17 I    seems to become the Amiga standard
  152.     34 V    for you Macintosh freaks
  153.     15 Y    good ol' Emacs
  154.  
  155.    Note that you can't change parameters while Snap is running.
  156.    You have to remove and restart Snap to change anything.
  157.    The character and line delay may be necessary with some
  158.    programs that can't handle the amount of characters the Snap
  159.    insert into the input stream. CygnusEd is known to have problems
  160.    with this. TxED handles inserted characters very nicely.
  161.    The delay is specified in ticks, 50 ticks per second.
  162.  
  163.  
  164. Snapping
  165.  
  166.    Snapping comes in two flavors; characters and graphics.
  167.    Snapping graphics simply means that you can frame an
  168.    area on screen and that area is copied into a window.
  169.    Character snapping can be made in four different ways:
  170.    * rectangular snapping
  171.    * character oriented snapping
  172.    * word oriented snapping
  173.    * line oriented snapping
  174.  
  175.    Rectangular snapping makes it possible to snap a column
  176.    of text. A carriage return is inserted after each row,
  177.    except the last one.
  178.  
  179.    Line oriented snapping is much the same as rectangular
  180.    snapping, except that the width of the rectangle is the
  181.    width of the window.
  182.  
  183.    Character oriented snapping is much harder to explain than
  184.    to use. Character oriented snapping starts at one character,
  185.    extends to the right edge of the window, goes on with
  186.    complete lines, and ends at another character. The select box
  187.    can look like this: ________________________
  188.     __________________|                        |
  189.    |                                           |
  190.    |                 __________________________|
  191.    |________________|
  192.  
  193.    or like this:                      _________
  194.     _____                            |_________|
  195.    |_____|
  196.  
  197.    and of course like this:    ________________
  198.                               |________________|
  199.  
  200.    Word oriented snapping works the same way as character
  201.    oriented, except that you can only extend the selection
  202.    word by word. A word is defined as non-blanks surrounded
  203.    by blanks.
  204.  
  205.  
  206.    Let's define some actions used when controlling snap.
  207.  
  208.    CLICK
  209.       1. Press the mouse button.
  210.       2. Release the mouse button.
  211.  
  212.    MOVE
  213.       1. Move the mouse.
  214.  
  215.    PREPARE_TEXT
  216.       1. If you are using Xerox style snapping, make sure that your
  217.          intended destination window is active.
  218.       2. Press and hold the text qualifier (Default: Left Amiga key).
  219.       3. MOVE to the first character you want to copy.
  220.  
  221.    PREPARE_GFX
  222.       1. Press and hold the graphics qualifier (Default: Right Amiga key).
  223.       2. MOVE to the upper left corner of the area you want to copy
  224.  
  225.    EXTEND
  226.       1. MOVE
  227.       5. (Press and) Release the mouse button.
  228.  
  229.    END
  230.       1. Release the mouse button.
  231.       2. Release the qualifier.
  232.  
  233.    CANCEL
  234.       1. Release the qualifier.
  235.       2. Release the mouse button.
  236.  
  237.  
  238.    Ways to use these actions:
  239.    This is with starting unit FRAME. Selecting starting unit CHAR will
  240.    skip rectangular snapping and take you directly to character oriented
  241.    snapping. To do rectangular snapping you have to click through char,
  242.    word and line oriented back to rectangular snapping.
  243.  
  244.    To do rectangular snapping:
  245.     1. PREPARE_TEXT.
  246.     2. Press the left mouse button.
  247.     3. MOVE.
  248.     4. EXTEND until satisfied.
  249.     5. END or CANCEL.
  250.  
  251.    To do character oriented snapping
  252.     1. PREPARE_TEXT.
  253.     2. CLICK the left mouse button.
  254.     3. EXTEND until satisfied.
  255.     4. END or CANCEL.
  256.  
  257.    To do word oriented snapping
  258.     1. PREPARE_TEXT.
  259.     2. Double-CLICK left mouse button.
  260.     3. EXTEND until satisfied.
  261.     4. END or CANCEL.
  262.  
  263.    To do line oriented snapping
  264.     1. PREPARE_TEXT.
  265.     2. Triple-CLICK left mouse button.
  266.     3. EXTEND until satisfied.
  267.     4. END or CANCEL.
  268.  
  269.    To insert snapped characters (BKSYSBUF "You know ;-)")
  270.     1. PREPARE_TEXT.
  271.     2. CLICK the right mouse button.
  272.    or
  273.     1. Press and hold the left amiga key.
  274.     2. Type the insert key as specified with -i (Default "I").
  275.  
  276.    To abort insertion
  277.     1. CLICK the left mouse button.
  278.  
  279.    To snap graphics
  280.     1. PREPARE_GFX.
  281.     2. Press the left mouse button.
  282.     3. MOVE.
  283.     4. EXTEND until satisfied.
  284.     5. END or CANCEL.
  285.  
  286.    When snapping text you can go directly from snapping to
  287.    inserting by replacing "END or CANCEL" above with
  288.    "Release left mouse button - CLICK right mouse button".
  289.    If you are using Xerox style snapping, the snapped text
  290.    will be inserted as soon as you END.
  291.    When selecting snapping unit a fourth click takes you
  292.    back to character oriented snapping. Each click steps
  293.    one unit. Note that rectangular snapping only is available
  294.    if you MOVE before you release the mouse button.
  295.    Another thing: You must always start snapping at a character,
  296.    otherwise Snap won't get the coordinates right. This applies
  297.    to all kinds of snapping including line snapping.
  298.    Trailing blanks are removed on each line when you're snapping
  299.    characters, words or lines.
  300.    Windows with graphic snaps are always opened on the Workbench
  301.    screen.
  302.  
  303.  
  304. Compiling
  305.  
  306.    A 'makefile' is provided for Manx-Aztec users. Note the
  307.    use of a precompiled header file containing all amiga-specific
  308.    include files.
  309.    Conversion to Lattice shouldn't be to hard, I hope.
  310.  
  311.  
  312. Some things to remember
  313.  
  314.    a. The text is sent to the active window. Make sure that
  315.       the correct window is active.
  316.    b. Don't interfere when the text is being inserted. Any key
  317.       pressed by you will be inserted in the middle of the text
  318.       being inserted.
  319.    c. Snap begins with an attempt to find the character coordinates.
  320.       Therefore if you begin snapping on a space, Snap will almost
  321.       certainly get the wrong coordinates.
  322.    d. To be able to do Xerox style snapping, Snap disables
  323.       ActivateWindow when the text qualifier is held down.
  324.       By doing this Snap makes sure that the destination window
  325.       remains active when you move out of it, even if you are
  326.       using DMouse or another Sun mouse utility.
  327.  
  328.  
  329. Bugs
  330.  
  331.    Of course, what did you think. Well, as far as I know there
  332.    are no explicit bugs. Oh yes, there is one that I don't know
  333.    how to solve. The problem is that some font editors optimize
  334.    the character image data. The result is that two characters
  335.    with the same image (e.g. I and l in some fonts) uses the
  336.    same image data, thereby making it impossible for Snap to
  337.    determine which character was printed in the first place.
  338.    This can be solved by editing the font so that each character
  339.    is unique.
  340.    It seems like there is a problem with JRComm. Any spaces snapped
  341.    using JRComm's internal font are interpreted as ascii 0. The
  342.    problem doesn't occur when you use an external font.
  343.  
  344.  
  345. Changes
  346.  
  347.   Björn Knutsson pointed out that it wasn't possible to Snap
  348.   the rightmost characters in a borderless window. Now I look
  349.   at the window flags for border and resize gadget, instead
  350.   of just subtracting.
  351.   Ants! I've always thought that the Macintosh's crawling ants
  352.   were neat. Here it is. New option: -aXXXX  - Ants.
  353.   You still can't shrink the selection down to one line. Sorry.
  354.   Björn Knutsson also had some problems when trying to start
  355.   snapping at the leftmost character in a window. A couple of
  356.   small changes has been made to simplify this.
  357.   Major: At last I got rid of the 8-point-wide limit. Thanks to
  358.   Michel Denber for pushing me over the edge on that one.
  359.   Lost and found accented chars 128-255. Watch out for signed tests.
  360.   A key combination for insert is now available.
  361.   Bold characters are now supported. Combinations (bold+inverted)
  362.   are not supported. And Björn Knutsson keeps telling me that
  363.   he wants underlined too. Sigh. Some people are never satisfied.
  364.   Combinations are a potential problem. I'm afraid that implementing
  365.   all combinations will make the character recognition too slow.
  366.   Handler code cleaned up.
  367.   Better gfx snapping, similar to rect snapping. Change corner,
  368.   ants (crawling the other way :-), better edge checking.
  369.   Xerox style snapping with immediate insert. Option -x.
  370.   Stricter control in the input handler. Unused button events when
  371.   snapping are IECLASS_NULLed without mercy.
  372.   Made it possible to shrink the selection back to one line and char.
  373.   Added the option to select char or frame snapping as startint unit.
  374.   Option to select bit planes to draw selection frame into.
  375.  
  376.  
  377. Improvements
  378.  
  379.    I've been thinking about adding a way for programs to "register"
  380.    their windows with Snap so that Snap can let the program handle
  381.    the snapping by itself. As an example: Snapping an icon as text
  382.    doesn't make much sense, so the program displaying the icon
  383.    could take over and put the name of the file in the clipboard.
  384.    A character-mapped window could also benefit from this.
  385.    Another obvious improvement is to make Snap recognize proportional
  386.    fonts. Don't hold your breath.
  387.    The ability to save snapped graphics as an IFF-file? Tell me if you
  388.    want it. It will cost some memory though. Perhaps if I could find
  389.    a good iff.library?
  390.    Built-in help? Naah...
  391.    Converting to one loader and one handler.
  392.    Prepending and appending characters.
  393.  
  394.  
  395. s-mail: Mikael Karlsson
  396.         Lövsättersvägen 10
  397.         S-585 98  LINKÖPING
  398.         SWEDEN
  399.  
  400. e-mail: micke@slaka.sirius.se
  401.         micke@slaka.UUCP
  402.         {mcvax|munnari|seismo}!enea!liuida!slaka!micke
  403.  
  404. Phone:  +46-13 50479
  405.         +46-431 50623 (in the summer)
  406.