Ignore:
Timestamp:
Nov 9, 2007, 3:32:25 PM (17 years ago)
Author:
garnier
Message:

r627@mac-90108: laurentgarnier | 2007-11-09 07:57:42 +0100
modif dans les includes directives

Location:
trunk/geant4/interfaces/basic/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/interfaces/basic/src/G4UIArrayString.cc

    r483 r593  
    2626//
    2727// $Id: G4UIArrayString.cc,v 1.8 2006/06/29 19:09:43 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030
  • trunk/geant4/interfaces/basic/src/G4UIQt.cc

    r579 r593  
    2525//
    2626//
    27 // $Id: G4UIQt.cc,v 1.14 2007/05/29 11:09:49 $
    28 // GEANT4 tag $Name: geant4-08-01 $
     27// $Id: G4UIQt.cc,v 1.3 2007/11/08 17:00:09 lgarnier Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030// L. Garnier
     
    4646#include "G4Qt.hh"
    4747
    48 #include <QtGui/qapplication.h>
    49 #include <QtGui/qwidget.h>
    50 #include <QtGui/qmenu.h>
    51 #include <QtGui/qmenubar.h>
    52 #include <QtGui/qboxlayout.h>
    53 #include <QtGui/qpushbutton.h>
    54 #include <QtGui/qlabel.h>
    55 #include <QtGui/qsplitter.h>
    56 #include <QtGui/qscrollbar.h>
    57 #include <QtGui/qdialog.h>
    58 #include <QtGui/qevent.h>
     48#include <QtGui/QApplication.h>
     49#include <QtGui/QMainWindow.h>
     50#include <QtGui/QLineEdit.h>
     51#include <QtGui/QWidget.h>
     52#include <QtGui/QMenu.h>
     53#include <QtGui/QMenuBar.h>
     54#include <QtGui/QBoxLayout.h>
     55#include <QtGui/QPushButton.h>
     56#include <QtGui/QLabel.h>
     57#include <QtGui/QSplitter.h>
     58#include <QtGui/QScrollBar.h>
     59#include <QtGui/QDialog.h>
     60#include <QtGui/QEvent.h>
     61#include <QtGui/QListWidget.h>
     62#include <QtGui/QTextEdit.h>
     63#include <QtGui/QTreeWidget.h>
     64#include <QtCore/QSignalMapper.h>
     65
    5966
    6067#include <stdlib.h>
  • trunk/geant4/interfaces/basic/src/G4UIQt_moc.cc

    r577 r593  
    22** Meta object code from reading C++ file 'G4UIQt.hh'
    33**
    4 ** Created: Mon Sep 17 14:28:15 2007
     4** Created: Mon Oct 1 10:59:35 2007
    55**      by: The Qt Meta Object Compiler version 59 (Qt 4.2.2)
    66**
    77** WARNING! All changes made in this file will be lost!
    88*****************************************************************************/
     9
     10#ifdef G4UI_BUILD_QT_SESSION
    911
    1012#include "../include/G4UIQt.hh"
     
    99101    QMetaObject::activate(this, &staticMetaObject, 0, _a);
    100102}
     103
     104#endif
  • trunk/geant4/interfaces/basic/src/G4UIWin32.cc

    r483 r593  
    2626//
    2727// $Id: G4UIWin32.cc,v 1.13 2006/06/29 19:09:45 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030// G.Barrand
  • trunk/geant4/interfaces/basic/src/G4UIXaw.cc

    r483 r593  
    2626//
    2727// $Id: G4UIXaw.cc,v 1.6 2006/06/29 19:09:47 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030// G.Barrand
  • trunk/geant4/interfaces/basic/src/G4UIXm.cc

    r483 r593  
    2626//
    2727// $Id: G4UIXm.cc,v 1.14 2006/06/29 19:09:49 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030// G.Barrand
  • trunk/geant4/interfaces/basic/src/G4UIcsh.cc

    r483 r593  
    2626//
    2727// $Id: G4UIcsh.cc,v 1.8 2006/06/29 19:09:51 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030
  • trunk/geant4/interfaces/basic/src/G4UItcsh.cc

    r483 r593  
    2525//
    2626//
    27 // $Id: G4UItcsh.cc,v 1.12 2006/06/29 19:09:54 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// $Id: G4UItcsh.cc,v 1.15 2007/11/06 09:36:23 kmura Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030
     
    3737#include <ctype.h>
    3838#include <sstream>
     39#include <fstream>
     40#include <stdlib.h>
    3941
    4042// ASCII character code
     
    5961static const int AsciiPrintableMin = 32;
    6062
     63// history file
     64static const G4String historyFileName= "/.g4_hist";
     65
    6166/////////////////////////////////////////////////////////
    6267G4UItcsh::G4UItcsh(const G4String& prompt, G4int maxhist)
     
    6974  // get current terminal mode
    7075  tcgetattr(0, &tios);
     76
     77  // read a shell history file
     78  G4String homedir= getenv("HOME");
     79  G4String fname= homedir + historyFileName;
     80
     81  std::ifstream histfile;
     82  enum { BUFSIZE= 1024 }; char linebuf[BUFSIZE];
     83
     84  histfile.open(fname, std::ios::in);
     85  while (histfile.good()) {
     86    if(histfile.eof()) break;
     87
     88    histfile.getline(linebuf, BUFSIZE);
     89    G4String aline= linebuf;
     90    aline.strip(G4String::both);
     91    if(aline.size() !=  0) StoreHistory(linebuf);
     92  }
     93  histfile.close();
    7194}
    7295
     
    7598/////////////////////
    7699{
    77 }
     100  // store a shell history
     101  G4String homedir= getenv("HOME");
     102  G4String fname= homedir + historyFileName;
     103
     104  std::ofstream histfile;
     105  histfile.open(fname, std::ios::out);
     106
     107  G4int n0hist= 1;
     108  if( currentHistoryNo > maxHistory ) n0hist= currentHistoryNo-maxHistory+1;
     109
     110  for (G4int i=n0hist; i<= currentHistoryNo; i++) {
     111    histfile << RestoreHistory(i) << G4endl;
     112  }
    78113 
    79 ///////////////////////////
     114  histfile.close();
     115}
     116
     117//////////////////////////////////////////
    80118void G4UItcsh::MakePrompt(const char* msg)
    81 ///////////////////////////
     119//////////////////////////////////////////
    82120{
    83121  if(promptSetting.length()<=1) {
     
    130168}
    131169
     170
     171//////////////////////////////
     172void G4UItcsh::ResetTerminal()
     173//////////////////////////////
     174{
     175  RestoreTerm();
     176}
     177
     178
    132179// --------------------------------------------------------------------
    133180//      commad line operations
     
    465512
    466513  G4int jt= input.find_last_of('/');
    467   if(jt<jhead) jt=G4String::npos;
     514  if(jt<jhead) jt=G4int(G4String::npos);
    468515
    469516  if(jt==G4int(G4String::npos)) jt= jhead;
     
    472519  G4String dspstr;
    473520  G4int i;
    474   for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS); // cleanup
     521  for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS);
    475522  for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(' ');
    476523  for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS);
     
    592639}
    593640
    594 ///////////////////////////////////
     641//////////////////////////////////////////////////
    595642G4String G4UItcsh::GetCommandLine(const char* msg)
    596 ///////////////////////////////////
     643//////////////////////////////////////////////////
    597644{
    598645  SetTermToInputMode();
  • trunk/geant4/interfaces/basic/src/G4UIterminal.cc

    r483 r593  
    2525//
    2626//
    27 // $Id: G4UIterminal.cc,v 1.21 2006/06/29 19:09:56 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
    29 //
    30 
     27// $Id: G4UIterminal.cc,v 1.27 2007/10/29 18:49:45 asaim Exp $
     28// GEANT4 tag $Name:  $
     29//
     30// ====================================================================
     31//   G4UIterminal.cc
     32//
     33// ====================================================================
    3134#include "G4Types.hh"
    3235#include "G4StateManager.hh"
     
    3841#include <sstream>
    3942
    40 
    41 //////////////////////////////////////////////
    42 G4UIterminal::G4UIterminal(G4VUIshell* aShell)
    43 //////////////////////////////////////////////
     43#ifndef WIN32
     44#include <signal.h>
     45#endif
     46
     47// ====================================================================
     48// signal handler for soft-abort
     49// ====================================================================
     50
     51static G4VUIshell* theshell= 0;
     52
     53#ifndef WIN32
     54
     55extern "C" {
     56
     57////////////////////////////////
     58static void SignalHandler(G4int)
     59////////////////////////////////
     60{
     61  G4StateManager* stateManager= G4StateManager::GetStateManager();
     62  G4ApplicationState state= stateManager-> GetCurrentState();
     63
     64  if(state==G4State_GeomClosed || state==G4State_EventProc) {
     65    G4cout << "aborting Run ...";
     66    G4UImanager::GetUIpointer()->ApplyCommand("/run/abort");
     67    G4cout << G4endl;
     68  } else {
     69    G4cout << G4endl
     70           << "Session terminated." << G4endl;
     71    theshell-> ResetTerminal();
     72    exit(0);
     73  }
     74
     75  // for original Unix / System V
     76  signal(SIGINT, SignalHandler);
     77}
     78
     79}
     80#endif
     81
     82// ====================================================================
     83//
     84// class description
     85//
     86// ====================================================================
     87
     88///////////////////////////////////////////////////////////
     89G4UIterminal::G4UIterminal(G4VUIshell* aShell, G4bool qsig)
     90///////////////////////////////////////////////////////////
    4491{
    4592  UI= G4UImanager::GetUIpointer();
     
    5299  if(aShell) shell= aShell;
    53100  else shell= new G4UIcsh;
     101  theshell= shell; // locally stored for the signal handler
     102
     103  // add signal handler
     104  if(qsig) {
     105#ifndef WIN32
     106  signal(SIGINT, SignalHandler);
     107#endif
     108  }
    54109}
    55110
  • trunk/geant4/interfaces/basic/src/G4VUIshell.cc

    r483 r593  
    2525//
    2626//
    27 // $Id: G4VUIshell.cc,v 1.9 2006/06/29 19:09:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// $Id: G4VUIshell.cc,v 1.10 2007/06/14 05:44:58 kmura Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030
     
    5959}
    6060
    61 /////////////////////////////
     61////////////////////////////////////////////
    6262void G4VUIshell::MakePrompt(const char* msg)
    63 /////////////////////////////
     63////////////////////////////////////////////
    6464{
    6565  if(promptSetting.length()<=1) {
     
    106106
    107107
     108////////////////////////////////
     109void G4VUIshell::ResetTerminal()
     110////////////////////////////////
     111{
     112
     113}
     114
    108115// --------------------------------------------------------------------
    109116//      G4command operations
     
    308315  arrayString.Show(nColumn);
    309316}
     317
Note: See TracChangeset for help on using the changeset viewer.