00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef G4UIGAG_h
00038 #define G4UIGAG_h 1
00039
00040 #include "G4UIsession.hh"
00041 #include "G4UImanager.hh"
00042 #include <fstream>
00043 #include <vector>
00044
00045 enum UImode { terminal_mode , java_mode, tcl_mode };
00046 enum ChangeOfTree { notChanged=0, added, deleted, addedAndDeleted };
00047
00048
00049
00050
00051
00052
00053
00054 class G4UIGAG : public G4UIsession
00055 {
00056 public:
00057 G4UIGAG();
00058 ~G4UIGAG();
00059
00060 G4UIsession * SessionStart();
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 void PauseSessionStart(G4String);
00071 G4int ReceiveG4cout(G4String);
00072 G4int ReceiveG4cerr(G4String);
00073
00074
00075
00076 void SessionTerminate();
00077 void Prompt(G4String);
00078 G4String GetCommand();
00079
00080 private:
00081 G4String prefix;
00082 G4UImanager * UI;
00083 G4String promptCharacter;
00084 G4bool iExit;
00085 G4bool iCont;
00086 UImode uiMode;
00087
00088 private:
00089 G4String JVersion;
00090 G4String TVersion;
00091 void ExecuteCommand(G4String);
00092 void ChangeDirectory(G4String);
00093 void ListDirectory(G4String);
00094 void TerminalHelp(G4String);
00095 G4String ModifyPrefix(G4String);
00096 G4UIcommandTree * FindDirPath(G4String);
00097 void ShowCurrent(G4String);
00098 G4String GetFullPath(G4String);
00099
00100 void SendCommandProperties(G4UIcommandTree *);
00101 void SendParameterProperties(G4UIcommandTree *);
00102 void SendAParamProperty(G4UIcommand *);
00103 void SendATclParamProperty(G4UIcommand *);
00104 void CodeGenJavaTree(G4UIcommandTree *,int recursiveLevel);
00105 void CodeGenJavaParams(G4UIcommandTree *,int recursiveLevel);
00106 void CodeGenTclTree(G4UIcommandTree *, int recursiveLevel);
00107 void CodeGenTclParams(G4UIcommandTree *, int recursiveLevel);
00108 void SendDisableList(G4UIcommandTree *, int recursiveLevel);
00109
00110 void NotifyStateChange(void);
00111 void NotifyCommandUpdate(void);
00112 void NotifyParameterUpdate(G4UIcommand *);
00113
00114 int CommandUpdated(void);
00115 void UpdateState(void);
00116 void UpdateParamVal(void);
00117
00118
00119
00120 void GetNewTreeStructure( G4UIcommandTree*,int recursiveLevel);
00121 void GetNewTreeValues( G4UIcommandTree*,int recursiveLevel);
00122
00123 std::vector<G4String> previousTreeCommands;
00124 std::vector<G4String> newTreeCommands;
00125 std::vector<G4String> previousTreeParams;
00126 std::vector<G4String> newTreeParams;
00127 std::vector<G4UIcommand*> previousTreePCP;
00128 std::vector<G4UIcommand*> newTreePCP;
00129
00130 };
00131
00132 #endif