source: trunk/geant4/interfaces/html/G4Qt_8cc-source.html @ 574

Last change on this file since 574 was 571, checked in by garnier, 17 years ago

r581@mac-90108: laurentgarnier | 2007-08-17 17:30:26 +0200
deplacement de frame

  • Property svn:mime-type set to text/html
File size: 11.2 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>G4Qt.cc Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5</head><body>
6<!-- Generated by Doxygen 1.3.4 -->
7<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8<h1>G4Qt.cc</h1><a href="G4Qt_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">//</span>
900002 <span class="comment">// ********************************************************************</span>
1000003 <span class="comment">// * License and Disclaimer                                           *</span>
1100004 <span class="comment">// *                                                                  *</span>
1200005 <span class="comment">// * The  Geant4 software  is  copyright of the Copyright Holders  of *</span>
1300006 <span class="comment">// * the Geant4 Collaboration.  It is provided  under  the terms  and *</span>
1400007 <span class="comment">// * conditions of the Geant4 Software License,  included in the file *</span>
1500008 <span class="comment">// * LICENSE and available at  http://cern.ch/geant4/license .  These *</span>
1600009 <span class="comment">// * include a list of copyright holders.                             *</span>
1700010 <span class="comment">// *                                                                  *</span>
1800011 <span class="comment">// * Neither the authors of this software system, nor their employing *</span>
1900012 <span class="comment">// * institutes,nor the agencies providing financial support for this *</span>
2000013 <span class="comment">// * work  make  any representation or  warranty, express or implied, *</span>
2100014 <span class="comment">// * regarding  this  software system or assume any liability for its *</span>
2200015 <span class="comment">// * use.  Please see the license in the file  LICENSE  and URL above *</span>
2300016 <span class="comment">// * for the full disclaimer and the limitation of liability.         *</span>
2400017 <span class="comment">// *                                                                  *</span>
2500018 <span class="comment">// * This  code  implementation is the result of  the  scientific and *</span>
2600019 <span class="comment">// * technical work of the GEANT4 collaboration.                      *</span>
2700020 <span class="comment">// * By using,  copying,  modifying or  distributing the software (or *</span>
2800021 <span class="comment">// * any work based  on the software)  you  agree  to acknowledge its *</span>
2900022 <span class="comment">// * use  in  resulting  scientific  publications,  and indicate your *</span>
3000023 <span class="comment">// * acceptance of all terms of the Geant4 Software license.          *</span>
3100024 <span class="comment">// ********************************************************************</span>
3200025 <span class="comment">//</span>
3300026 <span class="comment">//</span>
3400027 <span class="comment">// $Id: G4Qt.cc,v 1.11 2007/05/29 11:10:28 $</span>
3500028 <span class="comment">// GEANT4 tag $Name: geant4-08-01 $</span>
3600029 <span class="comment">//</span>
3700030 <span class="comment">// L. Garnier</span>
3800031
3900032 <span class="preprocessor">#if defined(G4INTY_BUILD_QT) || defined(G4INTY_USE_QT)</span>
4000033 <span class="preprocessor"></span>
4100034 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
4200035 <span class="preprocessor">#include &lt;string.h&gt;</span>
4300036
4400037 <span class="preprocessor">#include "G4ios.hh"</span>
4500038
4600039 <span class="preprocessor">#include "<a class="code" href="G4Qt_8hh.html">G4Qt.hh</a>"</span>
4700040
4800041 <span class="preprocessor">#define NewString(str)  \</span>
4900042 <span class="preprocessor"> ((str) != NULL ? (strcpy((char*)malloc((unsigned)strlen(str) + 1), str)) : NULL)</span>
5000043 <span class="preprocessor"></span>
5100044 <span class="comment">//static void XWidgetIconify                 (Widget);</span>
5200045 <span class="comment">//static void XWidgetUniconify               (Widget);</span>
5300046 <span class="comment">//static void XDisplaySetWindowToNormalState (Display*,Window);</span>
5400047
55<a name="l00048"></a><a class="code" href="classG4Qt.html#v0">00048</a> <a class="code" href="classG4Qt.html">G4Qt</a>* <a class="code" href="classG4Qt.html#v0">G4Qt::instance</a>    = NULL;
5600049
57<a name="l00050"></a><a class="code" href="G4Qt_8cc.html#a0">00050</a> <span class="keyword">static</span> G4bool <a class="code" href="G4Qt_8cc.html#a0">QtInited</a>  = FALSE;
5800051 <span class="comment">//static int    argn      = 0;</span>
5900052 <span class="comment">//static char** args      = NULL;</span>
6000053 <span class="comment">// static QtAppContext appContext = NULL;</span>
6100054 <span class="comment">//static QApplication app = NULL;</span>
6200055
6300056 <span class="comment">/***************************************************************************/</span>
64<a name="l00057"></a><a class="code" href="classG4Qt.html#e0">00057</a> <a class="code" href="classG4Qt.html">G4Qt</a>* <a class="code" href="classG4Qt.html#e0">G4Qt::getInstance</a> (
6500058 )
6600059 <span class="comment">/***************************************************************************/</span>
6700061 {
6800062   <span class="keywordflow">return</span> <a class="code" href="classG4Qt.html#e0">G4Qt::getInstance</a> (0,NULL,(<span class="keywordtype">char</span>*)<span class="stringliteral">"Geant4"</span>);
6900063 }
7000064 <span class="comment">/***************************************************************************/</span>
71<a name="l00065"></a><a class="code" href="classG4Qt.html#e1">00065</a> <a class="code" href="classG4Qt.html">G4Qt</a>* <a class="code" href="classG4Qt.html#e0">G4Qt::getInstance</a> (
7200066  <span class="keywordtype">int</span>    a_argn
7300067 ,<span class="keywordtype">char</span>** a_args
7400068 ,<span class="keywordtype">char</span>*  a_class
7500069 )
7600070 <span class="comment">/***************************************************************************/</span>
7700072 {
7800073   <span class="keywordflow">if</span> (<a class="code" href="classG4Qt.html#v0">instance</a>==NULL) {
7900074     <a class="code" href="classG4Qt.html#v0">instance</a> = <span class="keyword">new</span> <a class="code" href="classG4Qt.html#d0">G4Qt</a>(a_argn,a_args,a_class);
8000075   }
8100076   <span class="keywordflow">return</span> <a class="code" href="classG4Qt.html#v0">instance</a>;
8200077 }
8300078 <span class="comment">/***************************************************************************/</span>
84<a name="l00079"></a><a class="code" href="classG4Qt.html#d0">00079</a> <a class="code" href="classG4Qt.html#d0">G4Qt::G4Qt</a> (
8500080  <span class="keywordtype">int</span>    a_argn
8600081 ,<span class="keywordtype">char</span>** a_args
8700082 ,<span class="keywordtype">char</span>*  a_class
8800083 )
8900084 <span class="comment">/***************************************************************************/</span>
9000086 {
9100087   <span class="keywordflow">if</span>(<a class="code" href="G4Qt_8cc.html#a0">QtInited</a>==FALSE) {  <span class="comment">//Qt should be Inited once !</span>
9200088
9300089     <span class="keyword">new</span> QApplication (a_argn, a_args);
9400090
9500091     <span class="keywordflow">if</span>(qApp==NULL) {
9600092       G4cout        &lt;&lt; <span class="stringliteral">"G4Qt : Unable to init Qt."</span> &lt;&lt; G4endl;
9700093     }
9800094     <a class="code" href="G4Qt_8cc.html#a0">QtInited</a>  = TRUE;
9900095     <a class="code" href="classG4VInteractorManager.html#a4">SetMainInteractor</a> (qApp);
10000096   }
10100097   <a class="code" href="classG4VInteractorManager.html#a2">SetArguments</a>      (a_argn,a_args);
10200098   <span class="comment">//  AddDispatcher     ((G4DispatchFunction)XtDispatchEvent);</span>
10300099 }
10400100 <span class="comment">/***************************************************************************/</span>
105<a name="l00101"></a><a class="code" href="classG4Qt.html#a3">00101</a> <a class="code" href="classG4Qt.html#a3">G4Qt::~G4Qt</a> (
10600102 )
10700103 <span class="comment">/***************************************************************************/</span>
10800105 {
10900106   <span class="keywordflow">if</span>(<span class="keyword">this</span>==<a class="code" href="classG4Qt.html#v0">instance</a>) {
11000107     <a class="code" href="classG4Qt.html#v0">instance</a> = NULL;
11100108   }
11200109 }
11300110 <span class="comment">/***************************************************************************/</span>
114<a name="l00111"></a><a class="code" href="classG4Qt.html#a0">00111</a> G4bool <a class="code" href="classG4Qt.html#a0">G4Qt::Inited</a> (
11500112 )
11600113 <span class="comment">/***************************************************************************/</span>
11700115 {
11800116   <span class="keywordflow">return</span> <a class="code" href="G4Qt_8cc.html#a0">QtInited</a>;
11900117 }
12000118 <span class="comment">/***************************************************************************/</span>
121<a name="l00122"></a><a class="code" href="classG4Qt.html#a1">00122</a> <span class="keywordtype">void</span>* <a class="code" href="classG4Qt.html#a1">G4Qt::GetEvent</a> (
12200123 )
12300124 <span class="comment">/***************************************************************************/</span>
12400126 {
12500127 <span class="comment">//FIXME</span>
12600128 <span class="comment">//   G4cout        &lt;&lt; "G4Qt : Rien compris a cette fonction G4Qt::GetEvent." &lt;&lt; G4endl;</span>
12700129 <span class="comment">//  static XEvent  event;</span>
12800130 <span class="comment">//  if(appContext==NULL) return NULL;</span>
12900131 <span class="comment">//  if(mainApp==NULL) return NULL;</span>
13000132 <span class="comment">//  QtAppNextEvent (appContext, &amp;event);</span>
13100133 <span class="comment">//  return         &amp;event;</span>
13200134   printf(<span class="stringliteral">"*"</span>);
13300135 }
13400136 <span class="comment">/***************************************************************************/</span>
135<a name="l00137"></a><a class="code" href="classG4Qt.html#a2">00137</a> <span class="keywordtype">void</span> <a class="code" href="classG4Qt.html#a2">G4Qt::FlushAndWaitExecution</a> (
13600138 )
13700139 <span class="comment">/***************************************************************************/</span>
13800141 {
13900142 <span class="comment">//FIXME</span>
14000143    G4cout        &lt;&lt; <span class="stringliteral">"G4Qt : Rien compris a cette fonction G4Qt::FlushAndWaitExecution."</span> &lt;&lt; G4endl;
14100144 <span class="comment">//  if(mainApp==NULL) return;</span>
14200145 <span class="comment">//  XSync(QtDisplay(mainApp),False);</span>
14300146 }
14400147
14500148 <span class="preprocessor">#endif</span>
14600149 <span class="preprocessor"></span>
14700150
14800151
149</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Jun 22 11:07:01 2007 by
150<a href="http://www.doxygen.org/index.html">
151<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
152</a>1.3.4 </small></address>
153</body>
154</html>
Note: See TracBrowser for help on using the repository browser.