00001 /** @file tcl/eventloop.h singleton class that operates the tcl main 00002 event loop, reading commands from a script file or from stdin, 00003 with readline-enabled command-line editing */ 00004 00005 /////////////////////////////////////////////////////////////////////// 00006 // 00007 // Copyright (c) 2002-2004 California Institute of Technology 00008 // Copyright (c) 2004-2007 University of Southern California 00009 // Rob Peters <rjpeters at usc dot edu> 00010 // 00011 // created: Mon Jul 22 16:32:01 2002 00012 // commit: $Id: eventloop.h 11876 2009-10-22 15:53:06Z icore $ 00013 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/tcl/eventloop.h $ 00014 // 00015 // -------------------------------------------------------------------- 00016 // 00017 // This file is part of GroovX 00018 // [http://ilab.usc.edu/rjpeters/groovx/] 00019 // 00020 // GroovX is free software; you can redistribute it and/or modify it 00021 // under the terms of the GNU General Public License as published by 00022 // the Free Software Foundation; either version 2 of the License, or 00023 // (at your option) any later version. 00024 // 00025 // GroovX is distributed in the hope that it will be useful, but 00026 // WITHOUT ANY WARRANTY; without even the implied warranty of 00027 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00028 // General Public License for more details. 00029 // 00030 // You should have received a copy of the GNU General Public License 00031 // along with GroovX; if not, write to the Free Software Foundation, 00032 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00033 // 00034 /////////////////////////////////////////////////////////////////////// 00035 00036 #ifndef GROOVX_TCL_EVENTLOOP_H_UTC20050628162420_DEFINED 00037 #define GROOVX_TCL_EVENTLOOP_H_UTC20050628162420_DEFINED 00038 00039 namespace rutz 00040 { 00041 class fstring; 00042 } 00043 00044 namespace tcl 00045 { 00046 class interpreter; 00047 class event_loop; 00048 } 00049 00050 /// Singleton class that operates the main Tcl event loop. 00051 /** Its responsibilities include gathering text commands from standard 00052 input, dispatching window-system events, and dispatching 00053 timer-callbacks and idle-callbacks. */ 00054 class tcl::event_loop 00055 { 00056 public: 00057 event_loop(int argc, char** argv, bool nowindow); 00058 ~event_loop(); 00059 00060 static bool is_interactive(); 00061 00062 static tcl::interpreter& interp(); 00063 00064 static void run(); 00065 00066 /// Get the application's number of command-line arguments. 00067 static int argc(); 00068 00069 /// Get the application's command-line arguments. 00070 static const char* const* argv(); 00071 00072 /// Get the whole command-line as a single string. 00073 static rutz::fstring command_line(); 00074 00075 private: 00076 event_loop(const event_loop&); 00077 event_loop& operator=(const event_loop&); 00078 }; 00079 00080 static const char __attribute__((used)) vcid_groovx_tcl_eventloop_h_utc20050628162420[] = "$Id: eventloop.h 11876 2009-10-22 15:53:06Z icore $ $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/tcl/eventloop.h $"; 00081 #endif // !GROOVX_TCL_EVENTLOOP_H_UTC20050628162420_DEFINED