home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / mint / mint095b / toswin.doc < prev    next >
Encoding:
Text File  |  1993-08-03  |  13.5 KB  |  312 lines

  1. TOSWIN: a background program accessory for MiNT
  2. Written by Eric R. Smith (eric.smith@uwo.ca)
  3.  
  4. This version of TOSWIN is copyright 1992 Eric R. Smith. All rights
  5. reserved. TOSWIN may be distributed only with MiNT 0.95, and only
  6. if no profit is made on its distribution.
  7.  
  8.  
  9. TOSWIN is a simple accessory that gives an easy way of running
  10. TOS programs in the background of a GEM session. Selecting this accessory
  11. pops up a window with a scrapbook icon and a menu bar. The menu bar
  12. contains drop down menus; to open a window, select "Open Std Window"
  13. or "Open Alt Window" from the "File" menu. This will pop up a file
  14. selector box; use this box to select the program you want to run. Of
  15. course, this should *not* be a GEM program; you already have a GEM program
  16. running, or you wouldn't be able to get to the accessory. GEM will likely
  17. become horribly confused if there are two programs making GEM calls
  18. simultaneously.
  19.  
  20. Closing the TOSWIN window has the effect of closing the accessory, so
  21. that all windows are hidden. They will all re-appear when "TOS programs"
  22. is selected again from the DESK menu.
  23.  
  24. Closing any other window kills all the programs running in that window.
  25. Be careful!
  26.  
  27.  
  28.  
  29. MENUS
  30.  
  31. File:
  32.     Open Std Window
  33.     Opens a standard size (i.e. the same size as the line A variables)
  34.     window.
  35.     Open Alt Window
  36.     Opens a different size window. The size defaults to 80x50, but
  37.     this may be changed with the "Set Alt Window Size..." Global
  38.     menu entry.
  39.     Close
  40.     Closes the topmost window.
  41.     Load Config...
  42.     Loads a configuration file previously saved by Save Config...
  43.     TOSWIN looks for a config file called TOSWIN.CNF when starting
  44.     up, and loads it automatically if found.
  45.     Save Config...
  46.     Save the current menu settings and position of the scrapbook icon
  47.     in a file. The user is prompted for whether or not to save
  48.     window positions.
  49.     Set Menu Keys...
  50.     Allows keyboard equivalents to be established for any menu entries.
  51.     Any key (except spacebar) may be used as a menu equivalent, although
  52.     obviously the use of standard ASCII codes would be undesirable :-(.
  53.  
  54.     Quit
  55.     Exit TOSWIN after sending SIGHUP to all child processes.
  56.  
  57. Edit:
  58.     Copy
  59.     Copies the currently selected region in the top window to the
  60.         scrapbook.
  61.     Paste
  62.     Pastes the contents of the scrapbook into the top window.
  63.     Paste Options...
  64.     Controls how data is copied and pasted; for example, whether end
  65.     of line should be sent to applications as a carriage return,
  66.     line feed, or combination.
  67.  
  68. Global:
  69.     Align Windows
  70.     If this is set, TOSWIN will adjust all windows so that the text
  71.     inside them falls on a byte boundary. This should speed up
  72.     the VDI output a bit, at least for fixed width fonts that are
  73.     8 pixels wide.
  74.     Application Menus
  75.     If this option is set, and a window is opened for which an associated
  76.     .MNU file is found, then the application's menu will be loaded and
  77.     displayed in the status line of the window.
  78.     Autoclose
  79.     If this option is set, windows are automatically closed when no more
  80.     processes can send data to them. Otherwise, the string <EXITED>
  81.     is written to the window and it remains open until the user closes
  82.     it manually.
  83.     Smooth Scrolling
  84.     Causes the window contents to be updated more often (after every line)
  85.     if set.
  86.     Flourishes
  87.     If set, grow/shrink boxes appear for windows and dialog boxes.
  88.     Set Std Window Size...
  89.     Sets the number of rows and columns for windows opened with the
  90.     "Open Std Window" menu option, or which are run via TOSRUN.
  91.     This option also changes the line A variables to reflect the
  92.     new "standard" size. When specifying a window's rows and
  93.     columns, you may also specify a "scrollback" size. This many rows
  94.     of data are kept around even after they scroll off the top of
  95.     the window, and may be accessed via the vertical scroll bar and
  96.     scroll arrows (or via any keys assigned to the "Gadgets/Scroll Up"
  97.     and "Gadgets/Scroll Down" menu items).
  98.     Set Alt Window Size...
  99.     Sets the number of rows and columns for windows opened with the
  100.     "Open Alt Window"
  101.     Set Default Font...
  102.     Sets the default font for new windows. Any GDOS font may be used
  103.     in a window (this assumes, of course, that you're running GDOS!).
  104.     Even proportional fonts may be used, although they may produce
  105.     strange looking results if used with certain programs :-).
  106.     Set Default Gadgets...
  107.     Sets the default gadgets for new windows. Windows may have no
  108.     gadgets, a title bar (including closer and fuller), or a full
  109.     complement of gadgets including sizer, sliders, arrow, and title
  110.     bar. Windows may also have a menu bar; if a .MNU file is found
  111.     that goes with the program being started in the window, it may
  112.     be loaded and displayed. If no .MNU is found, no menu is displayed
  113.     for this window.
  114.     Environment...
  115.     Instructs TOSWIN about how to set up the environment for new
  116.     processes. The default setting (use ARGV, and set TERM, TERMCAP,
  117.     LINES, and COLUMNS) is the one usually desired.
  118.     Redraw Screen
  119.     Sends a redraw message to all windows, and re-draws the menu
  120.     bar as well.
  121.  
  122. The "Window" and "Gadgets" menus are only applicable to the topmost window,
  123. and since the topmost window is the "TOSWIN" window when the menu is
  124. active, they items in these menus cannot be accessed directly. Instead, you
  125. must use the "Set Menu Keys" option to assign keyboard equivalents for
  126. the menu items below:
  127.  
  128. Window:
  129.  
  130.     Bury Window
  131.         If more than one TOSWIN window is open on screen, a new window
  132.     (i.e. not the current top one) is brought to the top. Repeated
  133.     application will cycle through all open windows.
  134.     Iconify Window
  135.     Make the window small and put it "out of the way". Iconified windows
  136.     may be dragged around without making them bigger; they are
  137.     expanded again by a single click.
  138.     Send Literal Character
  139.     The next character typed will be sent to the application running
  140.     in the top window, regardless of whether the key is a menu
  141.         equivalent or not.
  142.     Set Window Size...
  143.     Change the number of rows and columns for the top window; this probably
  144.     won't change the appearance on screen (unless the new size is
  145.     radically smaller). It will, however, make more or less space available
  146.     via the sliders. Changing the window size causes a SIGWINCH signal
  147.     to be sent to the process group running in the window.
  148.     Set Font...
  149.     Change the font of the top window.
  150.     Set Gadgets...
  151.     Change the gadgets (slider, title, etc.) showing on the top
  152.     window.
  153.  
  154. Gadgets:
  155.  
  156.     Toggle Full
  157.     Has the same effect as clicking on the "full" box of a window.
  158.     Move Window
  159.     A pointing finger appears; move this to the location to which
  160.     you want the window moved, and click the mouse.
  161.     Scroll Up
  162.     Has the same effect as the "up arrow" gadget of a window.
  163.     Scroll Down
  164.     Has the same effect as the "down arrow" gadget of a window.
  165.     Scroll Left
  166.     Has the same effect as the "left arrow" gadget of a window.
  167.     Scroll Right
  168.     Has the same effect as the "right arrow" gadget of a window.
  169.  
  170. WINDOWS
  171.  
  172. Text in a window may be selected by the usual operation of holding down
  173. the mouse button and sweeping out a region. Single clicking on a window
  174. will unselect any text previously selected. Selected text appears in
  175. inverse video. A block of selected text may be dragged to another
  176. (or the same) window; when this is done, the effect is as though
  177. the user typed the selected text at the keyboard while the target window
  178. was on top. Selected text may also be dragged to the clipboard icon to
  179. paste it to the clipboard. Dragging the clipboard icon to a window pastes
  180. the contents of the clipboard into the window.
  181.  
  182. Windows may be resized, moved, etc. with the normal window gadgets, or
  183. with the mouse if the control key is held down. To resize a window without
  184. a sizer box, hold down the control key and press the left mouse button
  185. at the lower right hand corner of the window. To "full" the window do
  186. the same thing at the upper right hand corner; and to move the window
  187. hold down the control key and press the left mouse button anywhere else
  188. in the window. Scrolling of a window without scroll bars may be done
  189. via the Gadgets menu.
  190.  
  191. Closing a window sends a SIGHUP signal to the process group running in
  192. the window. Pressing CTRL-C or CTRL-\ sends a SIGINT or SIGQUIT
  193. signal to the process group in the current top window.
  194.  
  195. APPLICATION MENUS
  196.  
  197. When a new window is opened, TOSWIN looks for a file with the same path
  198. and name as the program being executed, but with a .MNU extension instead
  199. of the program's extension (e.g. if C:\MINT\TOP.TTP is being launched,
  200. TOSWIN looks for C:\MINT\TOP.MNU). If found, this .MNU file is loaded and
  201. the menu described therein is displayed whenever the given window is the
  202. top one and the "Application Menus" option is set. This allows .TOS and
  203. .TTP programs to have a simple menu driven interface provided for them
  204. with little effort.
  205.  
  206. The format of the .MNU file is quite straightforward. Lines beginning
  207. in the first column (i.e. no leading white space) are menu titles.
  208. Lines beginning with white space represent menu entries. The first
  209. word (sequence of non-white space characters, or characters between
  210. double quote marks) is the menu entry itself. The second word represents
  211. a string which will be sent to the application when this menu is
  212. selected. The characters of the string are represented by the 4
  213. hexadecimal digits which make up their VDI key codes, e.g. 6100
  214. is the UNDO key. The final word in the line is a keyboard equivalent
  215. for this menu item; 0000 means no equivalent is provided.
  216.  
  217. If the menu entry string begins with a minus sign '-', then it will
  218. be disabled. If it consists of nothing but '-' characters, then it
  219. will be expanded to stretch across the full length of the menu.
  220.  
  221. TERMINAL EMULATION
  222.  
  223. TOSWIN tries hard to make windows look like a regular ST console. For
  224. example, the shift key status and scan codes are sent when keys are typed
  225. in a window, and the "Standard" window size matches what the line A says
  226. is the size of a window. All the VT52 escape codes are interpreted. One
  227. oddity is that ESC-b and ESC-c (set foreground and background colors) use
  228. VDI colors instead of line-A colors; but unlike MW, different colored
  229. characters can appear on the screen together. Also, note that only 16 different
  230. text colors are supported.
  231.  
  232. TOSWIN extensions to the ST's terminal emulation ( (MW) indicates that
  233. the extension is shared by Allan Pratt's MW window manager as well ).
  234.  
  235. ESC Q        Quote next character; the next character is output
  236.         without any control character interpretation taking
  237.         place. (MW)
  238. ESC R        Set window size; the next text should be an ASCII
  239.         string representing (in decimal) the number of
  240.         columns the window should have, followed by a comma
  241.         and the number of rows the window should have, and
  242.         terminated by a carriage return. For example, the
  243.         command:
  244.             Cconws("\033R132,50\r");
  245.         will cause the window to be resized to 132 columns by
  246.         50 rows. If either the columns or rows is missing (or
  247.         zero) then it is left unchanged.
  248. ESC S        Set title bar; text up to the next carriage return
  249.         is placed in the window's title bar. (MW)
  250. ESC T        Send TERMCAP string. A TERMCAP description for the
  251.         window is sent just as though the user had typed it.
  252.         The string begins with TERMCAP= and ends with a
  253.         carriage return.
  254. ESC a        Delete the character at the current cursor position. (MW)
  255. ESC h        Enter insert mode. (MW)
  256. ESC i        Leave insert mode. (MW)
  257. ESC y <C>    Set text effects. The low 5 bits of the next character
  258.         (<C>) are used to determine which text effects should
  259.         be turned on:
  260.         0x0001: Bold text
  261.         0x0002: Dim text
  262.         0x0004: Slanted text
  263.         0x0008: Underlined text
  264.         0x0010: Reverse video
  265. ESC z <C>    Clear text effects. The low 5 bits of the next character
  266.         are used to determine which effects should be turned off.
  267.         See the description of ESC y for more details.
  268.  
  269.  
  270. ENVIRONMENT
  271.  
  272. TOSWIN will put several variables into the environment of the top level
  273. process in a new window, including:
  274.  
  275. LINES=        POSIX's way of telling how many lines and columns a
  276. COLUMNS=    window has
  277.  
  278. TERMCAP=    A complete termcap style description of the terminal
  279.         capabilities.
  280. TERM=tw52    Goes with the TERMCAP= above.
  281.  
  282. The Atari standard ARGV= argument passing mechanism is also used by
  283. TOSWIN, so ARGV= and arguments are put into the environment.
  284.  
  285. Besides the environment variables, TOSWIN also uses the TIOCSWINSZ
  286. Fcntl option on the pseudo-terminal associated with a window. Whenever
  287. a window's size is changed, a new TIOCSWINSZ call is made and also
  288. a SIGWINCH signal is sent to the process group running in the window.
  289. tcsh, for example, notices this and updates its environment variables
  290. accordingly.
  291.  
  292.  
  293. BUGS
  294.  
  295. Things to do/known bugs:
  296.  
  297. (1) Italic text isn't always redrawn correctly (it can be chopped
  298.     off on the left by the cursor).
  299. (2) TOSWIN doesn't know that bold text can be wider than normal
  300.     text, and so again redraws get messed up (this mostly happens
  301.     with proportional text).
  302. (3) The "Copy" and "Paste" menu items should be disabled when
  303.     there is no data available on the clipboard.
  304. (4) TOSWIN chokes on 0 width characters in proportional fonts. (Well, OK,
  305.     it doesn't choke on them -- but the screen display can get quite messed
  306.     up if 0 width characters are showing!).
  307. (5) There should be a program to make .MNU files.
  308. (6) More flexible .MNU files would be nice (e.g. the entries in
  309.     the "Toggles" menu for top should actually toggle in appearance,
  310.     and ways should be provided to check or disable application
  311.     menus.
  312.