Index: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/executeProgram.xml
===================================================================
--- trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/executeProgram.xml	(revision 1213)
+++ trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/executeProgram.xml	(revision 1222)
@@ -8,4 +8,5 @@
 <!--    Proof read by: Joe Chuma,  15-Jun-1999                -->
 <!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
+<!--    Updated by : Koichi Murakami, Dec-2009                -->
 <!--                                                          -->
 <!-- ******************************************************** -->
@@ -375,7 +376,6 @@
 <para>
 Most of the examples in the <literal>$G4INSTALL/examples/</literal> directory
-have the following <literal>main()</literal>, which covers cases 2 and 3
-above. Thus, the application can be run either in batch or
-interactive mode.
+have the following <literal>main()</literal>. 
+The application can be run either in batch or interactive mode.
 
 <example id="programlist_HowToExec_5">
@@ -411,5 +411,5 @@
   if (argc==1)   // Define UI terminal for interactive mode  
     { 
-     G4UIsession * session = new G4UIterminal;
+     G4UIExecutive* session = new G4UIExecutive(argc, argv);
      UI-&gt;ApplyCommand("/control/execute prerunN03.mac");    
      session-&gt;SessionStart();
Index: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/graphicalUserInterface.xml
===================================================================
--- trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/graphicalUserInterface.xml	(revision 1213)
+++ trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/graphicalUserInterface.xml	(revision 1222)
@@ -2,6 +2,7 @@
 <!--                                                          -->
 <!--  [History]                                               -->
+<!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
 <!--    Update G4UIExecutive : Laurent Garnier, Dec-2009      -->
-<!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
+<!--    Reviced : Koichi Murakami, Dec-2009                   -->
 <!--                                                          -->
 <!-- ******************************************************** -->
@@ -28,14 +29,16 @@
 
 <para>
-The "intercoms" category
-provides an expandable command interpreter. It is the key mechanism
-of Geant4 to realize secure user interactions of all categories without
-being annoyed by the dependencies among categories. The direct use
+The "intercoms" category provides an expandable command interpreter.
+It is the key mechanism of Geant4 to realize secure user interactions
+in all categories without being annoyed by the dependencies among categories. 
+<!-- 
+The direct use
 of Geant4 classes in a C++ program offers a first ground level of
 interactivity, i.e., the batch session. As seen in the
 examples/novice/N01, Geant4 commands and macros are to be
-hard-coded in the program.
-</para>
-
+hard-coded in the program.-->
+The Geant4 commands can be used both in a interactive terminal session and 
+in a batch mode with a maco file or a direct C++ call. 
+</para>
 
 
@@ -49,26 +52,27 @@
 
 <para>
-To avoid too much programming, the
-"intercoms" category provides the abstract class <emphasis>G4UIsession</emphasis>
-that captures interactive commands . The concrete implementation of
-the user interface and Graphical User Interfaces (GUI) is left to
-the interfaces category. This interfacing strategy opens an
-important door towards various user interface tools and allows
-Geant4 to utilize the state-of-the-art GUI tools such as Motif, Qt,
-and Java etc..The richness of the collaboration has permitted for
-developers to offer various user interfaces to the Geant4
-command system. Currently available are the following;
+Geant4 can be controllled by a seriese of Geant4 UI commands.
+The "intercoms" category provides the abstract class 
+<emphasis>G4UIsession</emphasis> that processes interactive commands. 
+The concrete implementation of (graphical) user interfaceis is located
+in the "interfaces" category. This interfacing strategy opens an
+important door towards various user interface tools, 
+and allows Geant4 to utilize the state-of-the-art GUI tools 
+such as Motif, Qt, and Java etc.
+The richness of the collaboration realizes
+various user interfaces to the Geant4 command system.
+The following interfaces is currently available;
 
 <orderedlist spacing="compact">
   <listitem><para>
-  Character terminal (dumb terminal and tcsh(bash)-like terminal), 
-  the default user interface of Geant4,
+  Character terminal (dumb terminal and tcsh-like terminal), 
+  that is the default user interface of Geant4
   </para></listitem>
   <listitem><para>
-  Xm, Win32, Qt variations of the upper terminal by using a
-  Motif, Qt or Windows widget to retrieve commands, and
+  Xm, Xaw, Win32, Qt variations of the above terminal by using a
+  Motif, Athena, Qt or Windows widget
   </para></listitem>
   <listitem><para>
-  GAG, a fully Graphical User Interface and its network extension
+  GAG, a fully graphical user interface and its network extension
   GainServer of the client/server type.
   </para></listitem>
@@ -77,15 +81,14 @@
 
 <para>
-Full implementation of the character
-terminals (1 and 2) is included in the standard Geant4 distribution
-in the <literal>source/interfaces/basic</literal> directory. As for GAG, 
-the front-end class is included
-in the Geant4 distribution in the source/interfaces/GAG directory,
-while its partner GUI package MOMO.jar is available in the standard Geant4 distribution 
-under the
-<literal>environments/MOMO</literal> directory. MOMO.jar, Java archive file, contains
+Implementation of the user sesssions (1 and 2) is included 
+in the <literal>source/interfaces/basic</literal> directory.
+As for GAG, the front-end class is included
+in the source/interfaces/GAG directory,
+while its partner GUI package MOMO.jar is available 
+under the <literal>environments/MOMO</literal> directory. 
+MOMO.jar, Java archive file, contains 
 not only GAG, but also GGE and other helper packages.
-Supplementary information is available
-from the author's Webpage(see URL below). 
+Supplementary information is available 
+from the author's web page (see URL below). 
 </para>
 
@@ -114,8 +117,64 @@
 <para>
 These interfaces open a session on the character terminal. 
-<emphasis>G4UIterminal</emphasis> runs on all platform supported by Geant4, 
-including <emphasis>cygwin</emphasis> on Windows, 
-while <emphasis>G4UItcsh</emphasis> runs on Solaris and Linux. G4UItcsh
-supports user-friendly key bindings a-la-tcsh (or bash);
+<emphasis>G4UIterminal</emphasis> runs on all platforms supported by Geant4, 
+including <emphasis>cygwin</emphasis> on Windows.
+
+The following built-in commands are available in 
+<emphasis>G4UIterminal</emphasis>;
+
+<variablelist>
+  <varlistentry>
+    <term>cd, pwd</term>
+    <listitem>
+    change, display the current command directory.
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term>ls, lc</term>
+    <listitem>
+    list commands and subdirectories in the current directory.
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term>history</term>
+    <listitem>
+    show previous commands.
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term>!historyID</term>
+    <listitem>
+    reissue previous command.
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term>?command</term>
+    <listitem>
+    show current parameter values of the command.
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term>help command</term>
+    <listitem>
+    show command help.
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term>exit</term>
+    <listitem>
+    terminate the session.
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+G4UItcsh supports user-friendly key bindings a-la-tcsh.
+<emphasis>G4UItcsh</emphasis> runs on Solaris and Linux.
+The following keybindings are supported;
 
 <variablelist>
@@ -197,6 +256,13 @@
 
 <para>
-In addition, the following string substitutions are supported;
-
+The example below shows how to set a user's prompt.
+<informalexample>
+<programlisting>
+  G4UItcsh* tcsh = new G4UItcsh();
+  tcsh-> SetPrompt("%s&gt;");
+</programlisting>
+</informalexample>
+
+The following strings are supported as substitutions in a prompt string.
 <variablelist>
   <varlistentry>
@@ -219,4 +285,11 @@
   </varlistentry>
 </variablelist>
+</para>
+
+<para>
+Command history in a user's session is saved 
+in a file <literal>$(HOME)/.g4_hist</literal>
+that is automatically read at the next session, 
+so that command history is available across sessions.
 </para>
 
@@ -226,5 +299,5 @@
 <sect3 id="sect.HowToSetUpInter.DescInter.G4UIXm">
 <title>
-<emphasis>G4UIXm</emphasis>, <emphasis>G4UIQt</emphasis> and 
+<emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis>, <emphasis>G4UIQt</emphasis> and 
 <emphasis>G4UIWin32</emphasis> classes
 </title>
@@ -232,8 +305,9 @@
 <para>
 These interfaces are versions of <emphasis>G4UIterminal</emphasis> 
-implemented over libraries Motif, Qt and WIN32 respectively. 
+implemented over libraries Motif, Athena, Qt and WIN32 respectively. 
 <emphasis>G4UIXm</emphasis> uses the Motif XmCommand widget, 
-<emphasis>G4UIQt</emphasis> the Qt dialog
-widget, and <emphasis>G4UIWin32</emphasis> the Windows "edit" component to do the
+<emphasis>G4UIXaw</emphasis> the Athena dialog
+widget, <emphasis>G4UIQt</emphasis> the Qt dialog widget, 
+and <emphasis>G4UIWin32</emphasis> the Windows "edit" component to do the
 command capturing. These interfaces are useful if working in
 conjunction with visualization drivers that use the Xt library, Qt library or
@@ -243,7 +317,7 @@
 <para>
 A command box is at disposal for entering or recalling Geant4 commands.
-Command completion by typing &amp;ldquo;TAB&amp;rdquo; key is
-available on the command line. The shell commands "exit, cont,
-help, ls, cd..." are also supported. A menu bar could be customized
+Command completion by typing "TAB" key is
+available in the command box. The shell commands "exit, cont,
+help, ls, cd..." are also supported. A menu bar can be customized
 through the <emphasis>AddMenu</emphasis> and 
 <emphasis>AddButton</emphasis> method. Ex:
@@ -278,5 +352,6 @@
 
 <para>
-<emphasis>G4UIXm</emphasis> runs on Unix/Linux with Motif. <emphasis>G4UIQt</emphasis> run 
+<emphasis>G4UIXm</emphasis> runs on Unix/Linux with Motif. <emphasis>G4UIXaw</emphasis>, 
+less user friendly, runs on Unix with Athena widgets. <emphasis>G4UIQt</emphasis> run 
 everywhere with Qt.
 <emphasis>G4UIWin32</emphasis> runs on Windows.
@@ -307,6 +382,6 @@
 <para>
 Client GUIs, GAG and Gain have almost similar look-and-feel. So,
-GAG's functionalities are briefly explained here. Please refer to
-the above URL for details.
+GAG's functionalities are briefly explained here. 
+Please refer to the URL previously mentioned for details.
 </para>
 
@@ -318,11 +393,10 @@
  an executable simulation program via pipes. Geant4's
 front-end class <emphasis>G4UIGAG</emphasis> must be instantiated to 
-communicate with GAG. GAG runs on Linux and Windows. If MOMO.jar is in your
-CLASSPATH, it can be run by a command;
+communicate with GAG. GAG runs on Linux and Windows.  MOMO.jar can be run by a command;
 </para>
 
 <informalexample>
 <programlisting>
-   %java -jar MOMO.jar
+   %java -jar  $G4INSTALL/environments/MOMO/MOMO.jar
 </programlisting>
 </informalexample>
@@ -335,17 +409,17 @@
     <term>GAG Menu:</term>
     <listitem>
-    The menus are to choose and run a GEANT4 executable file, to kill or exit
-    a GEANT4 process and to exit GAG. Upon the normal exit or an
+    The menus are to choose and run a Geant4 executable file, to kill or exit
+    a Geant4 process and to exit GAG. Upon the normal exit or an
     unexpected death of the Geant4 process, GAG window are
-    automatically reset to run another GEANT4 executable.    
-    </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>GEANT4 Command tree:</term>
-    <listitem>
-    Upon the establishment of the pipe connection with the GEANT4 process, GAG displays
+    automatically reset to run another Geant4 executable.    
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Geant4 Command tree:</term>
+    <listitem>
+    Upon the establishment of the pipe connection with the Geant4 process, GAG displays
     the command menu, using expandable tree browser whose look and feel is similar to
     a file browser. Disabled commands are shown in opaque. GAG
-    doesn &amp;rsquo;t display commands that are just below the root of
+    doesn't display commands that are just below the root of
     the command hierarchy. Direct type-in field is available for such
     input. Guidance of command categories and commands are displayed
@@ -375,5 +449,5 @@
     in the middle of a long session of execution. Log can be saved to a
     file independent of the above redirection . GAG displays warning or
-    error messages from GEANT4 in a pop-up warning widget.
+    error messages from Geant4 in a pop-up warning widget.
     </listitem>
   </varlistentry>
@@ -392,6 +466,6 @@
 
 <para>
-The libraries that don't depend on external packages are created by default, using
-Geant4 configure scripts. 
+The libraries that do not depend on external packages are created by default,
+using Geant4 configure scripts. 
 They include <emphasis>G4UIterminal</emphasis>, <emphasis>G4UItcsh</emphasis>
 and <emphasis>G4UIGAG</emphasis> in libraries <emphasis>libG4UIbasic.a/so</emphasis> and
@@ -401,9 +475,10 @@
 
 <para>
-To make the libraries of <emphasis>G4UIXm</emphasis>,
+To make the libraries of <emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis>,
  <emphasis>G4UIQt</emphasis> and
 <emphasis>G4UIWin32</emphasis> , respective environment variables
 <emphasis role="bold">G4UI_BUILD_XM_SESSION</emphasis>, 
-<emphasis role="bold">G4UI_BUILD_QT_SESSION</emphasis> or
+<emphasis role="bold">G4UI_BUILD_XAW_SESSION</emphasis>,
+<emphasis role="bold">G4UI_BUILD_QT_SESSION</emphasis> and
 <emphasis role="bold">G4UI_BUILD_WIN32_SESSION</emphasis> must be set
 explicitly before creating libraries.
@@ -411,5 +486,5 @@
 
 <para>
-However, if the environment variable <emphasis role="bold">G4UI_NONE</emphasis> is
+If the environment variable <emphasis role="bold">G4UI_NONE</emphasis> is
 set, no interface libraries are built at all.
 </para>
@@ -432,8 +507,9 @@
 <para>
 To use a given interface
-(<literal>G4UIxxx</literal> where <literal>xxx = terminal,Xm, Win32, Qt, 
-GAG, GainServer</literal>) in your program, you can do it by two ways :
+(<literal>G4UIxxx</literal> where <literal>xxx = terminal,Xm, Xaw, Win32, Qt, 
+GAG, GainServer</literal>) in your program, there are two ways.
+
 <itemizedlist spacing="compact">
-   <listitem><para> Calling G4UIxxx directly :
+   <listitem> Calling G4UIxxx directly :
    <informalexample>
    <programlisting>
@@ -446,6 +522,28 @@
    </programlisting>
    </informalexample>
-   Note : For a tcsh session, the second line must be (See the examples in "examples/novice/N0x" in which the terminal session is used) :
-
+
+   If you want to select a session type according to your environment variable,
+   the code can be:
+
+   <informalexample>
+   <programlisting>
+// to include the class definition in the main program:
+   #if defined(G4UI_USE_TCSH)
+     #include "G4UIterminal.hh"
+     #include "G4UItcsh.hh"
+   #elif defined(G4UI_USE_XM)
+     #include "G4UIXm.hh"
+   ....
+   #endif
+
+   #if defined(G4UI_USE_TCSH)
+     session = new G4UITerminal(new G4UItcsh);
+   #elif defined(G4UI_USE_XM)
+     session = new G4UIXm(argc,argv);
+   #elif ...
+  </programlisting>
+  </informalexample>
+
+   Note : For a tcsh session, the second line must be 
    <informalexample>
    <programlisting>
@@ -453,7 +551,22 @@
    </programlisting>
    </informalexample>
-   
-   </para></listitem>
-   <listitem><para>Using <emphasis>G4UIExecutive</emphasis> (implement in all novice examples) :
+
+If the user wants to deactivate the default signal handler (soft abort)
+raised by "Ctr-C", the false flag can be set in the second argument 
+of the <emphasis>G4UIterminal</emphasis> constructor like;
+
+<informalexample>
+<programlisting>
+   G4UIsession* session = new G4UIterminal(new G4UItcsh, false).
+</programlisting>
+</informalexample>
+   </listitem>
+
+
+   <listitem>Using <emphasis>G4UIExecutive</emphasis>
+   (implemented in all novice examples) :
+
+   The above code is rather troublesome. 
+   This is more convenient way for choosing a session type.
      <informalexample>
      <programlisting>
@@ -471,60 +584,13 @@
      </programlisting>
      </informalexample>
-</para>
-</listitem>
+   </listitem>
 </itemizedlist>
 </para>
 
-<para>The two methods are similar. If you want to choose between several viewer driver at load, with the <emphasis>first</emphasis> method you will have to write :
-<informalexample>
-<programlisting>
-// to include the class definition in the main program:
-   #if defined(G4UI_USE_TCSH)
-     #include "G4UIterminal.hh"
-     #include "G4UItcsh.hh"
-   #elif defined(G4UI_USE_XM)
-     #include "G4UIXm.hh"
-   ....
-   #endif
-
-   #if defined(G4UI_USE_TCSH)
-     session = new G4UITerminal(new G4UITerminal);
-   #elif defined(G4UI_USE_XM)
-     session = new G4UIXm(argc,argv);
-   #elif ...
-</programlisting>
-</informalexample>
-That is not realy simple. The best way to do this is the <emphasis>second</emphasis> method :
-<informalexample>
-<programlisting>
-   #ifdef G4UI_USE
-     #include "G4UIExecutive.hh"
-   #endif
-...
-
-// to instantiate a session of your choice and start the session
-// G4UIExecutive will open for you the good driver (depending on G4UI_USE_xxx flags)
-   #ifdef G4UI_USE
-     G4UIExecutive* ui = new G4UIExecutive(argc,argv);
-   #endif
-</programlisting>
-</informalexample>
-
-</para>
-<para>
-If the user wants to deactivate the default signal handler (soft abort)
-raised by "Ctr-C", the false flag can be set in the second argument 
-of the <emphasis>G4UIterminal</emphasis> constructor like;
-
-<informalexample>
-<programlisting>
-   G4UIsession* session = new G4UIterminal(new G4UItcsh, false).
-</programlisting>
-</informalexample>
-</para>
-
-<para>
-Again, environment variable must be preset to select a given interface. But for your
-convenience, some of them are set by defaults.
+
+<para>
+A corresponding environment variable must be preset 
+to select a given interface.
+But some of them are set by defaults for your convenience.
 
 <itemizedlist spacing="compact">
@@ -536,5 +602,6 @@
    always built (see "G4UI_BUILD.gmk") and linked, so the user can
    instantiate one of these sessions without rebuilding the libraries
-   and without setting any environment variables. For backwards
+   and without setting any environment variables. 
+   <!--For backwards
    compatibility with user code, as typified by geant4/examples main
    programs, the C-pre-processor variables corresponding to the
@@ -545,9 +612,9 @@
    if he/she sets no environment variables, then the C-pre-processor variable
    <emphasis role="bold">G4UI_USE_TERMINAL</emphasis> is set by default, 
-   although there is no need to use it.
+   although there is no need to use it.-->
    </para></listitem>
    <listitem><para>
    The environment variable <emphasis role="bold">G4UI_USE_XM</emphasis>, 
-<emphasis role="bold">G4UI_USE_QT</emphasis> or
+<emphasis role="bold">G4UI_USE_QT</emphasis>,   <emphasis role="bold">G4UI_USE_XAW</emphasis> or
    <emphasis role="bold">G4UI_USE_WIN32</emphasis> must be set to use the 
    respective interface. The file "$G4INSTALL/config/G4UI_USE.gmk"
Index: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/mainProgram.xml
===================================================================
--- trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/mainProgram.xml	(revision 1213)
+++ trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/mainProgram.xml	(revision 1222)
@@ -6,4 +6,5 @@
 <!--    Proof read by: Joe Chuma,  14-Jun-1999                -->
 <!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
+<!--    Updated by Koichi Murakami, Dec-2009                  -->
 <!--                                                          -->
 <!-- ******************************************************** -->
@@ -362,5 +363,5 @@
  #include "G4RunManager.hh"
  #include "G4UImanager.hh"
- <emphasis role="color_blue">#include "G4UIterminal.hh"</emphasis>
+ <emphasis role="color_blue">#include "G4UIExecutive.hh"</emphasis>
  #include "G4VisExecutive.hh"
 
@@ -395,5 +396,5 @@
     
    // get the pointer to the User Interface manager
-   G4UImanager* UI = G4UImanager::GetUIpointer();
+   G4UImanager* UImanager = G4UImanager::GetUIpointer();
 
  <emphasis role="color_blue">
@@ -401,8 +402,8 @@
    // Define (G)UI terminal for interactive mode
    {
-     G4UIsession * session = new G4UIterminal;
-     UI-&gt;ApplyCommand("/control/execute prerun.g4mac");
-     session-&gt;sessionStart();
-     delete session;
+     G4UIExecutive * ui = new G4UIExecutive(argc,argv);
+     UImanager-&gt;ApplyCommand("/control/execute prerun.g4mac");
+     ui-&gt;sessionStart();
+     delete ui;
    }
    else
@@ -411,5 +412,5 @@
      G4String command = "/control/execute ";
      G4String fileName = argv[1];
-     UI-&gt;ApplyCommand(command+fileName);
+     UImanager-&gt;ApplyCommand(command+fileName);
    }
 </emphasis>
