]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkInterpreter.h
*** empty log message ***
[bbtk.git] / kernel / src / bbtkInterpreter.h
index 66caed7ba5e2a90aa15234347954d4cdfd807c23..eb8e09c07b118d567b3dd2804c05276aa2d820bd 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/02/06 09:27:52 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2008/03/07 08:40:14 $
+  Version:   $Revision: 1.13 $
 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace bbtk
 {
+
+#ifdef _USE_WXWIDGETS_
+  class WxConsole;
+#endif
+  
   class BBTK_EXPORT Interpreter
   {
 
@@ -92,8 +97,6 @@ namespace bbtk
     /// Destructor
     ~Interpreter();
 
-   static Interpreter* mGlobalInterpreter;
-
     /// Launches a command line interpreter (with a prompt)
     void CommandLineInterpreter();
 
@@ -113,8 +116,7 @@ namespace bbtk
     void SetDialogMode(DialogModeType t) { mExecuter->SetDialogMode(t); }
 
     /// Runs the interpretation of a file
-    void InterpretFile( const std::string& filename, 
-                       bool use_configuration_file=true);
+    void InterpretFile( const std::string& filename);
 
     /// Interprets a line (either from a file or typed interactively)
     void InterpretLine( const std::string& line, bool &insideComment );
@@ -131,8 +133,7 @@ namespace bbtk
                            CommandInfoType& info );
 
     /// Switch to the interpretation of a file
-    void SwitchToFile( const std::string& filename, 
-                      bool use_configuration_file=true);
+    void SwitchToFile( const std::string& filename );
 
     /// Closes the currently open file
     void CloseCurrentFile();
@@ -167,6 +168,20 @@ namespace bbtk
     /// Sets the bool that indicates wether we are in command line context
     void SetCommandLine(bool v = true) { mCommandLine = v; }
 
+#ifdef _USE_WXWIDGETS_
+    /// Sets the WxConsole that created the interpreter (if any)
+    void SetWxConsole(WxConsole* c) { mWxConsole = c; }
+    /// Gets the WxConsole that created the interpreter (if any) 
+    WxConsole* GetWxConsole() { return mWxConsole; }
+    /// Gets the WxConsole that created the interpreter (if any) - const 
+    const WxConsole* GetWxConsole() const { return mWxConsole; }
+#endif
+
+    /// Gets the Executer 
+    VirtualExec* GetExecuter() { return mExecuter; }
+    /// Gets the Executer (const)
+    const VirtualExec* GetExecuter() const { return mExecuter; }
+
   private:
 
     /// Opens the file fullPathScriptName 
@@ -179,12 +194,14 @@ namespace bbtk
     //==================================================================
     // ATTRIBUTES
 
-    /// The factory
-    //    bbtk::Factory* mFactory;
-
-    /// The command executer
+    /// The command executer used
     bbtk::VirtualExec* mExecuter;
 
+#ifdef _USE_WXWIDGETS_
+    /// The WxConsole which uses the interpreter (0 if none)
+    bbtk::WxConsole* mWxConsole;
+#endif
+
     /// Vector of open files 
     std::vector<std::ifstream*> mFile;
 
@@ -207,6 +224,10 @@ namespace bbtk
     std::deque< char* > mHistory;
 
   };
+  // EO class Interpreter
+
+
+
 
 
   // The "Quit" exception