
                                    GLaunch
                                       
   This page documents glaunch, an applet designed to provide a basic but
   user friendly GUI frontend to programs which require
   difficult-to-remember command line arguments and enable those
   applications which run in an xterm, such as a telnet or rlogin
   session, to be launched from a window manager buttons such as
   Afterstep's Wharf or FVWMButtons without having to specify all the
   command lines in the configuration file.
   
   You can download the source from
   http://www.ma.man.ac.uk/~gowen/programs/glaunch.tar.gz . It require
   gtk+1.0.5 or newer, and the GNU compiler GCC. It has only been tested
   for Linux, but should work on any system with GCC and GTK+. Please
   report success/failure to gowen@ma.man.ac.uk
   
   Its other purpose, which is probably evident from anyone casting an
   expert eye over the code was to give myself some general C practice
   and as a first go at X programming and using the GTK widget set. As
   such, I make no apology for the poor technique in some of the code,
   and welcome any comments from those more knowledgeable. Thats how you
   learn, right?
   
Basic Principle

   The basic principle involved is that information about the command
   line options taken by a large number of programs is stored in a global
   configuration file maintained by the administrator, which may be
   overridden by a user configuration file, which is parsed by the
   program which then creates a dialog box on the fly to present these
   options to the user in a simple manner, with text boxes for entering
   filenames, hostnames etc. and check boxes for switches that are either
   on or off.
   
  An Example
  
   Here is an example line from the configuration file:
   /usr/bin/telnet:telnet:y:*:text:Hostname:-l:text:User name
   When invoked as glaunch telnet, the program will pop up a window
   looking like this:
   [Sample Dialog Box] 
   
   Another line in the configuration file, however, may look like this:
   /usr/bin/telnet:telnet-full:y:*:text:Hostname:-l:text:User
   name:-d:bool:Use Debugging:-8:bool:Use Eight Bit Characters:-E:bool:No
   Escape Character:-a:bool:Attempt Automatic Login
   and so when invoked as glaunch telnet-full the pop-up window looks
   like this:
   [Another Sample Dialog Box] 
   
   In both cases, when the user and host data is entered, an xterm window
   is created and a telnet session started in it, having been passed the
   correct command line arguments matching the choices made in the
   glaunch dialog box. The name and path of the xterm program, as well as
   the flag used to start an inferior process, default to
   "/usr/X11R6/bin/xterm" and "-e" respectively, but may be set at
   compile time.
   
   You can see a full sample .glaunchrc file here.
   
Details

   The only detail worthy of note in this simple program is the structure
   of the configuration files, which default to
   "/usr/local/lib/glaunchrc" and "~/.glaunchrc" but may be set at
   compile time. These files have the following structure:-
    1. Any line starting with a '#' is a comment. Comments and empty
       lines are ignored.
    2. Lines which aren't ignored are parsed as fields which are
       delimited by colons as follows:
          + The first field is the full path to the executable.
          + The second field is the name by which this is referred to on
            the command line, and in the title bar of the window.
          + The third field is 'y' or 'n' depending on whether the
            executable should be run as an inferior process in an xterm.
          + The remaining fields are parsed as sets of three with the
            following structure:
            <command line flag>:<type>:<caption>
            "command line flag" is the option which is passed to
            executable, or a '*' if no option flag is required. "type" at
            the moment is limited to "text" for a text box, "bool" for a
            check box, "file" for a text box with a little button which
            pops up file selection dialog box, "comptext" and "compfile"
            which are the same as "text" and "file" respectively, but
            must be specified or the "Run" button will not do anything.
       
   With reference to the example given above:
    1. "/usr/bin/telnet" is the executable.
    2. "telnet-full" is the name it is referred to as when glaunch is
       run.
    3. "y" means run it in an xterm.
    4. The next three fields mean that the first argument passed to
       telnet doesn't take a flag, is text and is the host name.
    5. The next three fields mean that the first argument passed to
       telnet follows the flag "-l", is text and is the user name.
    6. The next three fields mean that if the check box labeled "Use
       Debugging" is selected, telnet is passed the argument "-d",
       otherwise it isn't.
    7. The next three fields mean that if the check box labeled "Use
       Eight Bit Characters" is selected, telnet is passed the argument
       "-8", otherwise it isn't.
    8. And so on...
       
  Known Bugs and To Do
  
    Bugs
    
   The program is very intolerant of lines in the config files which
   don't precisely match the format given above. No checking is done as
   yet, which means that the programs tends to crash. This is really
   dumb.
   
    To Do
    
    1. Fix the last bits of code that don't allocate memory dynamically,
       but limit the number of discrete options to a number set out in a
       #define statement.
    2. Implement a whole bunch of other options, as and when they occur
       to me.
     _________________________________________________________________
   
   
   Last modified: Fri Jan 8 13:34:16 GMT 1999
   
   Valid HTML 4.0! 
   
   Home
   Mail Me
