#!/bin/sh
 
 # l_banner
 # ========

 # This file is part of Gerolf Markup Shredder,
 # written by G. D. Brettschneider (1999-2006).
 
 GMSdateL_BANNER=20060927
   
 # Prologue: ================================================================== 
   
 # Debug: Banners are out of the X/Y-debugging system (which uses banners) ... 
   
 # Size:
   
 BACKUP_SIZE=$REPLY_SIZE
 REPLY_SIZE=78
   
 BACKUP_OFFSET=$REPLY_OFFSET
 REPLY_OFFSET=0 
      
 # Chapters: ================================================================== 
   
 # Empty - show error:
 
 if [ "$1" = "" ]; then
   source ./l_banner -help
   exit
 
 # Debug: ---------------------------------------------------------------------
   
 elif [ $1 = -debug ]; then
 # Upper:
   REPLY_OFFSET=0
   REPLY_SIZE=23
   "$GMS_REPLY" -banner 2 "Module: $2"
   REPLY_OFFSET=20
   REPLY_SIZE=23
   "$GMS_REPLY" -banner 2 "Action: $3"
   REPLY_OFFSET=40
   REPLY_SIZE=23
   "$GMS_REPLY" -banner 2 "Hotkey: $4"
   REPLY_OFFSET=60
   REPLY_SIZE=22
   "$GMS_REPLY" -banner 2 "Coldkey: $5"
 # Lower:
   REPLY_OFFSET=0
   REPLY_SIZE=23
   "$GMS_REPLY" -banner 23 "Offset: $BACKUP_OFFSET"
   REPLY_OFFSET=20
   REPLY_SIZE=23
   "$GMS_REPLY" -banner 23 "Size: $BACKUP_SIZE"
   REPLY_OFFSET=40
   REPLY_SIZE=23
   "$GMS_REPLY" -banner 23 "Items: $REPLY_ITEMS" 
   REPLY_OFFSET=60
   REPLY_SIZE=22
   "$GMS_REPLY" -banner 23 "Data: $6" 
   DEBUG=
   if [ "$GMS_DEBUG" = "Y" ]; then sleep 1; fi
   
 # Diverse: -------------------------------------------------------------------
   
 # No module:   
 elif [ $1 = -no_module ]; then 
   "$GMS_REPLY" -banner 1 "GMS error: No module $2"
   REPLY_OFFSET=57
   REPLY_SIZE=25
   "$GMS_REPLY" -banner 1 "Gerolf Markup Shredder " 
   sleep 1 
   break
   
 # No action:   
 elif [ $1 = -no_action ]; then 
   "$GMS_REPLY" -banner 1 "GMS error: No action $3"
   REPLY_OFFSET=57
   REPLY_SIZE=25
   "$GMS_REPLY" -banner 1 "Module: $2 "
   sleep 1 
   
 # No hot:   
 elif [ $1 = -no_hot ]; then 
   "$GMS_REPLY" -banner 1 "GMS error: No hotkey $3"
   REPLY_OFFSET=57
   REPLY_SIZE=25
   "$GMS_REPLY" -banner 1 "Module: $2 "
   sleep 1 
   
 # No cold:   
 elif [ $1 = -no_cold ]; then 
   "$GMS_REPLY" -banner 1 "GMS error: No coldkey $3"
   REPLY_OFFSET=57
   REPLY_SIZE=25
   "$GMS_REPLY" -banner 1 "Module: $2 "
   
 # No file:   
 elif [ $1 = -no_file ]; then 
   "$GMS_REPLY" -banner 1 "GMS error: No file." 
   REPLY_OFFSET=57
   REPLY_SIZE=25
   "$GMS_REPLY" -banner 1 "Module: $2 "
   sleep 1 
   
 # Upper: ---------------------------------------------------------------------
 
 elif [ $1 = -upper ]; then
 
   # First upper banner: 
   if [ $2 = -first ]; then
     "$GMS_REPLY" -banner 1 "Gerolf Markup Shredder $GMS_VERSION"
     REPLY_OFFSET=54
     REPLY_SIZE=28
     "$GMS_REPLY" -banner 1 "MarkupShredder@Gerolf.org"
   
   # Last upper banner: 
   elif [ $2 = -last ]; then
     "$GMS_REPLY" -banner 1 "MarkupShredder@Gerolf.org"
     REPLY_OFFSET=65
     REPLY_SIZE=16
     "$GMS_REPLY" -banner 1 "www.Gerolf.org"
   
   # Write handbook title on upper banner: 
   elif [ $2 = -handbook ]; then
     "$GMS_REPLY" -banner 1 "handbook.html"
     REPLY_OFFSET=44
     REPLY_SIZE=38
     "$GMS_REPLY" -banner 1 "The Gerolf Markup Shredder Handbook"
 
   # Write current file on upper banner:   
   elif [ $2 = -file ]; then
     "$GMS_REPLY" -banner 1 "$GMS_FILE"
     REPLY_OFFSET=57
     REPLY_SIZE=25
     "$GMS_REPLY" -banner 1 "Gerolf Markup Shredder " 
   
   # Write current template on upper banner:   
   elif [ $2 = -template ]; then 
     "$GMS_REPLY" -banner 1 "Template: $GMS_TEMPLATEFILE"
     REPLY_OFFSET=57
     REPLY_SIZE=25
     "$GMS_REPLY" -banner 1 "Gerolf Markup Shredder " 
   
   fi
   
 # Lower: ---------------------------------------------------------------------
   
 elif [ $1 = -lower ]; then
 
   # Write domain on lower banner:   
   if [ $2 = -domain ]; then
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org "
   
   # First lower banner:   
   elif [ $2 = -first ]; then
     "$GMS_REPLY" -banner 24 "The typesetting program that uses TeX for"
     REPLY_OFFSET=43
     REPLY_SIZE=39
     "$GMS_REPLY" -banner 24 "document conversion from HTML to PDF "
   
   # Write current folder on lower banner:   
   elif [ $2 = -folder ]; then
     "$GMS_REPLY" -banner 24 "$GMS_FOLDER"
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org "
   
   # Write warning for select dialog   
   elif [ $2 = -select ]; then
     "$GMS_REPLY" -banner 24 "Warning: Changes done here will be written"
     REPLY_OFFSET=44
     REPLY_SIZE=38
     "$GMS_REPLY" -banner 24 "to the GMS launcher script 'gerolf' "
   
   # Write help text for menu animation:   
   elif [ $2 = -animate ]; then
     "$GMS_REPLY" -banner 24 "Menu animation is currently turned $GMS_ANIMATE"
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org "
   
   # Write help text for debugging:   
   elif [ $2 = -debug ]; then
     "$GMS_REPLY" -banner 24 "X: trace modules, Y: slow motion, Z: write log,"
     REPLY_OFFSET=49
     REPLY_SIZE=32
     "$GMS_REPLY" -banner 24 "0: no debug.    www.Gerolf.org "
   
   # Write help text for encoding:   
   elif [ $2 = -encode ]; then
     "$GMS_REPLY" -banner 24 "ISO-8859-1 Western, ISO-8859-2 Central,"
     REPLY_OFFSET=41
     REPLY_SIZE=41
     "$GMS_REPLY" -banner 24 "ISO-8859-5 Cyrillic, ISO-8859-6 Arabic "
   
   # Write help text for color dialog:   
   elif [ $2 = -color ]; then
     "$GMS_REPLY" -banner 24 "Enter a color or ASCII letter number"
     REPLY_OFFSET=38
     REPLY_SIZE=44
     "$GMS_REPLY" -banner 24 "(or 'R' for random changes of appearance) "
   
   # Write help text for codepage:   
   elif [ $2 = -codepage ]; then
     "$GMS_REPLY" -banner 24 "Show terminal codepage"
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org"
   
   # Write help text for codepage (upper half):   
   elif [ $2 = -cp_up ]; then
     "$GMS_REPLY" -banner 24 "Terminal codepage (upper half) - In HTML,"
     REPLY_OFFSET=43
     REPLY_SIZE=39
     "$GMS_REPLY" -banner 24 "write '&#255;' for character no. 255 " XX
   
   # Write help text for codepage (lower half):   
   elif [ $2 = -cp_lo ]; then
     "$GMS_REPLY" -banner 24 "American Standard Code for Information Interchange"
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org " XX
   
   # Write help text for programs:   
   elif [ $2 = -program ]; then
     "$GMS_REPLY" -banner 24 "Select programs to associate with GMS menu items"
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org "
   
   # Write help text for viewer:   
   elif [ $2 = -viewer ]; then
     "$GMS_REPLY" -banner 24 "Text viewers: more, less, xless, kless, ..."
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org "
   
   # Write help text for editor:   
   elif [ $2 = -editor ]; then 
     "$GMS_REPLY" -banner 24 "Text editors: nedit, kwrite, emacs, gedit, vi, ..."
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org "
   
   # Write help text for browser:   
   elif [ $2 = -browser ]; then 
     "$GMS_REPLY" -banner 24 "HTML browsers: lynx, links, mozilla,"
     REPLY_OFFSET=37
     REPLY_SIZE=45
     "$GMS_REPLY" -banner 24 "netscape, opera, konqueror, amaya, ... "
   
   # Write help text for analyst:   
   elif [ $2 = -analyst ]; then 
     "$GMS_REPLY" -banner 24 "HTML syntax checker: tidy"
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org "
   
   # Write help text for typesetter:   
   elif [ $2 = -tsetter ]; then 
     "$GMS_REPLY" -banner 24 "HTML typesetters: pdfetex, pdftex, etex, tex"
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org "
   
   # Write help text for reader:   
   elif [ $2 = -reader ]; then
     "$GMS_REPLY" -banner 24 "PDF readers: acroread, gv, kpdf, (k)ghostview, xpdf, ..."
     REPLY_OFFSET=65
     REPLY_SIZE=17
     "$GMS_REPLY" -banner 24 "www.Gerolf.org "   
   fi
   
 # Error: ---------------------------------------------------------------------
 
 else
   echo " This is Gerolf Markup Shredder: No l_banner $1 $2 "
   sleep 3   
 fi
 
 # Epilogue: ==================================================================
 
 REPLY_OFFSET=$BACKUP_OFFSET
 BACKUP_OFFSET=
 
 REPLY_SIZE=$BACKUP_SIZE 
 BACKUP_SIZE=
 
