1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: G4UIExecutive.icc,v 1.2 2009/05/15 07:15:16 kmura Exp $ |
---|
28 | // GEANT4 tag $Name: $ |
---|
29 | // |
---|
30 | // ==================================================================== |
---|
31 | // G4UIExecutive.icc |
---|
32 | // |
---|
33 | // ==================================================================== |
---|
34 | #include "G4UIsession.hh" |
---|
35 | #include "G4UImanager.hh" |
---|
36 | |
---|
37 | #if defined(G4UI_USE_TCSH) |
---|
38 | #include "G4UIterminal.hh" |
---|
39 | #include "G4UItcsh.hh" |
---|
40 | |
---|
41 | #elif defined(G4UI_USE_XM) |
---|
42 | #include "G4UIXm.hh" |
---|
43 | |
---|
44 | #elif defined(G4UI_USE_WIN32) |
---|
45 | #include "G4UIWin32.hh" |
---|
46 | |
---|
47 | #elif defined(G4UI_USE_QT) |
---|
48 | #include "G4UIQt.hh" |
---|
49 | #include "G4Qt.hh" |
---|
50 | |
---|
51 | #else |
---|
52 | #include "G4UIterminal.hh" |
---|
53 | #include "G4UIcsh.hh" |
---|
54 | |
---|
55 | #endif |
---|
56 | |
---|
57 | |
---|
58 | ///////////////////////////////////////////////////// |
---|
59 | #if defined(G4UI_USE_XM) || defined(G4UI_USE_WIN32) || defined(G4UI_USE_QT) |
---|
60 | G4UIExecutive::G4UIExecutive(G4int argc, char** argv) |
---|
61 | #else |
---|
62 | G4UIExecutive::G4UIExecutive(G4int, char**) |
---|
63 | #endif |
---|
64 | : session(0), shell(0) |
---|
65 | ///////////////////////////////////////////////////// |
---|
66 | { |
---|
67 | #if defined(G4UI_USE_TCSH) |
---|
68 | shell = new G4UItcsh; |
---|
69 | session = new G4UIterminal(shell); |
---|
70 | |
---|
71 | #elif defined(G4UI_USE_XM) |
---|
72 | session = new G4UIXm(argc, argv); |
---|
73 | |
---|
74 | #elif defined(G4UI_USE_WIN32) |
---|
75 | session = new G4UIWin32(); |
---|
76 | |
---|
77 | #elif defined(G4UI_USE_QT) |
---|
78 | session = new G4UIQt(argc, argv); |
---|
79 | |
---|
80 | #else |
---|
81 | shell = new G4UIcsh; |
---|
82 | session = new G4UIterminal(shell); |
---|
83 | |
---|
84 | #endif |
---|
85 | } |
---|
86 | |
---|
87 | /////////////////////////////// |
---|
88 | G4UIExecutive::~G4UIExecutive() |
---|
89 | /////////////////////////////// |
---|
90 | { |
---|
91 | } |
---|
92 | |
---|
93 | //////////////////////////////////////////////////////////// |
---|
94 | inline void G4UIExecutive::SetPrompt(const G4String& prompt) |
---|
95 | //////////////////////////////////////////////////////////// |
---|
96 | { |
---|
97 | if(shell) shell-> SetPrompt(prompt); |
---|
98 | } |
---|
99 | |
---|
100 | ////////////////////////////////////////////////////////////// |
---|
101 | inline void G4UIExecutive::SetLsColor(TermColorIndex dirColor, |
---|
102 | TermColorIndex cmdColor) |
---|
103 | ////////////////////////////////////////////////////////////// |
---|
104 | { |
---|
105 | if(shell) shell-> SetLsColor(dirColor, cmdColor); |
---|
106 | } |
---|
107 | |
---|
108 | ///////////////////////////////////////// |
---|
109 | inline void G4UIExecutive::SessionStart() |
---|
110 | ///////////////////////////////////////// |
---|
111 | { |
---|
112 | session-> SessionStart(); |
---|
113 | delete session; |
---|
114 | } |
---|
115 | |
---|