========================================================================== FrontTool Copyright (c) 1991 by Fabio Rossetti Freely Redistributable Software ========================================================================== NOTE WELL --------- You need Kickstart v2.xx or later to run this program, otherwise it will simply silently exit. Overview -------- One of the nicest new features of Workbench 2.0 is the ability to have special 'appicons' on the Workbench screen: these new icons do not belong to a file, a drawer, a trashcan or a disk but are created and displayed by application software with the new workbench.library. This way a program can be notified when a 'normal' icon is dropped on its appicon or when the appicon itself is clicked by the user. It is a method to better integrate utility software with the Workbench environment, basically: you could have for instance a IFF viewer program appicon in your Workbench window, then drop a IFF file icon on that and have your picture displayed with a mere mouse drag..The problem is, there are quite few (read almost none) such programs at the moment. Here FrontTool comes to the rescue: it's a software designed to allow older common CLI based programs to run with an appicon. You prepare a FrontTool Project icon, edit the proper ToolTypes to specify which program do you want to run and how, click the icon, and voila, you have a new appicon to drop other icons on to have some action performed...The Project icon image will become the new appicon image. Installation ------------ Into the archive you have just undoed, or into the drawer/directory you have already opened, you should have found this FrontTool.doc file, the FrontTool program (with its icons), and other sample icons. Copy FrontTool to your SYS:Utilities directory (the Utilities drawer of the Workbench (HD or floppy) you boot from). If you don't have an Utilities directory or don't want to use it you'll have to change the Default Tool field into the sample icons according to the path given to FrontTool. Thats'it (:-). To give it a try double click on the ReadText sample icon (you must have the More program that comes with WB 2.0 into your Utilities drawer). You now should have a new icon into the Workbench window, which looks the same as the ReadText one: try dropping a text file icon onto it and you'll read it with More in a moment.. There are several other sample icons, here's a brief description of them: ViewIFF: calls the Display program distributed with WB 2.0. Drop IFF ILBM file icons it. Mostra: calls the popular IFF viewer 'Mostra' by Sebastiano Vigna, it should be located in the C: directory and named 'M'. ViewText: calls the slick text viewer 'View80' by Federico Giannici, it should be located too into C:, and named 'View80'. ZapFile: calls the top-notch filezapper 'Hex' by Nicola Salmoria, this should be into the Tools drawer of Workbench.. List: this executes the Shell LIST command taking as arguments the names of the icons dropped onto the appicon.. EditFile: this calls the standard ED editor. If ED is substituted by the CygnusEd frontend with the same name it will work OK.. Adapting other programs to run with FrontTool --------------------------------------------- Run the IconEdit program (from WB 2.0), create a new Project type icon (or edit one of the sample icons), give it the image you like, save it somewhere with the name you want to give to the appicon, then exit IconEdit. There is no need for any kind of file to accompany the icon. Now click once the new icon and call the familiar Information window with the appropriate Workbench menu selection.. The Default Tool field must always be SYS:utilities/FrontTool or whatever path you've bothered to give the program. Set the Stack field to the stack size needed by your program. If in doubt consult the program docs: if there is no mention of special stack sizes to set, then you can safely leave the Stack field with its default value, 4096 bytes: in any case remember to NOT decrease the stack below that value, or you will almost certainly experience a severe system crash. Now create (or modify, if you are editing a sample icon) a ToolType named COMMAND. COMMAND's argument should be the name of the program to be called via appicon (better if with complete path), followed by a percent symbol ( '%' ) in place of the filename you would usually write in the Shell, and eventually by the other command's arguments in the usual order.. Basically, the COMMAND ToolType argument is the same as what you ordinarily type in CLI, except for the fact that you use a dummy file name ( '%' ) instead of a real one to tell FrontTool where to use the name of the icon you drop onto the appicon. Let's take for example the More program. In the Shell, to display the text file ram:mytext you would type: more ram:mytext With the FrontTool COMMAND ToolType you'll have.. COMMAND=SYS:Utilities/more % 'SYS:Utilities/more' is the complete path of the program, '%' is a sign to point where to put the real filename, that you give by dropping icons onto the appicons. If it's still not completely clear look at the COMMAND ToolTypes into the sample icons.. COMMAND is the only mandatory ToolType to use with a FrontTool Project icon, but there are other useful ToolTypes to tell FrontTool how to exactly run a program. The SPAWN ToolType can be set to YES or NO, and indicates wether FrontTool must wait or not for the COMMAND program to complete: in the latter case it's just like if the program was launched using the RUN command (on a more technical note: SPAWN=YES uses SystemTagList with SYS_ASynch set to TRUE). SPAWN defaults to NO. This may seem strange, but it's due to the fact that nowadays a lot of CLI programs are self-detaching (they don't need RUN, and return immediately the Shell prompt), and actually have no need at all of being SPAWNed by somebody..View80 and Hex e.g. fall in this category, while Mostra and Display are not self-detaching and work better if SPAWN=YES. The More program is a bit of his own: it behaves differently if it is used with RUN or not. In the first case it will use the standard input and output to display a file, in the latter it will open its own window and use it. There's no problem if you use it with SPAWN=YES (like in the sample icon), but otherwise you will have to specify a IO filename to see something (read below). The IO ToolType is used to specify an interactive file to redirect the standard input/output of the COMMAND program. An interactive file in almost all cases simply means a console CON: file like the ones used to open a CLI/Shell with a window of a specified size: you could use: IO=CON:10/10/500/200/MyProg to use your program with a window 500 pixels wide and 200 pixels high, titled 'MyProg' and with its top left corner distancing 10 pixels both from the left and top border of the Workbench screen.. IO defaults to NIL:, to use programs that write/accept input from the CLI you should set IO to a CON: file to see something. Remember that the CON: handler in Kickstart 2.0 offers two options very convenient for use with FrontTool: CLOSE will open the CON: window with a close gadget, and WAIT will wait to close the window after the program is ended until the user clicks that close gadge or sends an EOF charachter (CTRL-\). These options must be appended in the filename after the window title using slashes as usual: for example you could have such a IO ToolType: IO=CON:0/0/640/200/MyTool/CLOSE/WAIT If FrontTool can't open the file, or if it is not interactive, it will display a requester the first time you try to use the appicon and then delete it and exit. If you don't need or want interactive (console) input output you can tell FrontTool to redirect the I/O to a couple of separate files with the INPUT and OUTPUT ToolTypes, basically it's the same as with '<' and '>' in the CLI/Shell. INPUT and OUTPUT must obviously contain a couple of different filenames and both default to NIL: If you use them with an IO ToolType they will simply be ignored. If FrontTool can't open one or both files it will complain with a requester and then exit. The PRI ToolType is used to specify the priority your COMMAND program task is bound to run. You must use a decimal integer number in the range [-127,127]: if you go out of range or type wrong charachters FronTool will complain with a requester and exit. PRI defaults to zero. The NOQUOTE ToolType can be set to YES or NO. It defaults to NO, and in almost all cases you won't actually use it. If NOQUOTE=YES FrontTool will NOT put the icon filename into quotes ('"') as it is usually done to specify filenames with spaces in them (e.g. "Chessmaster 2100"); this is because there are very few and very stupid programs which do their command line parsing so poorly that they don't recognize a file name as such when it's enclosed in quotes. In the example above such programs would have seen TWO files, '"Chessmaster' and '2100"' .. Use NOQUOTE only if you experience problems, otherwise you will not be able to use icon names with spaces in them properly. Users with a bit of experience can use FrontTool with these ToolTypes options to accomplish lots of tasks: you could have appicons for printing files, scripts, ARexx programs, compilers, editors, TeX processing (TeX itself, previewing and printing..) etc. etc.. Using appicons -------------- After you have set all your ToolTypes properly you only need to click the Save gadget in the Workbench Information window and click the new FrontTool project icon. If everything goes well you will be able to see a new appicon into the Workbench window. Now you only need to drop single or multiple icons (selected with drag or extended select) onto the appicon and see the results: in the case of multiple icons FrontTool will of course repeat the COMMAND program for every icon.. To quit click twice the appicon itself: a requester will be popped to ask if you want to really quit or not. By using the Snapshot/Unsnapshot Workbench menu items on the PROJECT icon (not the appicon, it won't work) you'll be able to set/unset a specific position for your appicon in the Workbench window. If you want an appicon to show automatically every time you boot simply copy the icon into the WBStartup drawer, and put a DONOTWAIT ToolType (with no argument) in it. This is not another FrontTool ToolType but a Workbench one: it's used to run asynchronously programs in WBStartup. The sample icons already have it. From the next reboot onward you'll have your appicon at startup ready for use. Odds & Ends ----------- FrontTool is freely redistrutable, but NOT public domain: this means you can copy it as much as you like, but only a for a small fee (or free of charge!) and you are not allowed to modify it in any way, or sell it for profit. You are also prohibited to use FrontTool for any kind of military purposes. If you happen to have some praise, comments, criticism, plain loathing, flames, 2000 '040 boards (:-)) for me, you can send them to: Fidonet : Fabio Rossetti, 2:332/109.2 Internet: ross@teafi.sublink.org Fabio.Rossetti@p2.f109.n332.z2.fidonet.org or you can use snail mail (especially for those '040 boards!-): Fabio Rossetti Via Valdorcia, 22 FIRENZE I-50127 ITALY