PyApp.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef PyApp_H
15 #define PyApp_H
16 
17 #include <string>
18 
19 namespace hippodraw {
20 
21 class HdThread;
22 class Inspector;
23 class PyCanvas;
24 class QtApp;
25 
32 class PyApp
33 {
34 private:
35 
37  static PyApp * s_instance;
38 
40  static QtApp * s_app;
41 
44 
45 public:
46 
48  PyApp ( );
49 
51  PyApp ( int );
52 
54  PyApp ( char * script );
55 
58  ~PyApp ( );
59 
61  static PyApp * instance ();
62 
64  int exec();
65 
68  void quit ();
69 
73  bool hasTerminated () const;
74 
77 
79  void openDocument ( const std::string & filename );
80 
84  static void lock();
85 
88  static bool locked ();
89 
94  static void unlock();
95 
98  static bool hasPendingEvents ();
99 
103  void quitOnLastWindowClose ( bool yes );
104 
105 };
106 
107 } // namespace hippodraw
108 
109 #endif // PyApp_H
static bool hasPendingEvents()
Returns true if the application object has pending events.
Definition: PyApp.cxx:370
int exec()
Starts the QApplication event loop.
Definition: PyApp.cxx:258
This class is the public interface the what the user sees as the canvas object from Python...
Definition: PyCanvas.h:43
PyCanvas * currentCanvas()
Returns a pointer to the current CanvasWindow.
Definition: PyApp.cxx:287
static void lock()
Obtains a lock on the application&#39;s mutex.
Definition: PyApp.cxx:331
A derived class of QApplication that instantiates the components of HippoDraw.
Definition: QtApp.h:39
A derived class of QThread that runs the QApplication object.
Definition: HdThread.h:29
void quit()
Terminates the application.
Definition: PyApp.cxx:280
~PyApp()
The destructor.
Definition: PyApp.cxx:243
return yes
Definition: CanvasView.cxx:883
void quitOnLastWindowClose(bool yes)
If yes is true, allows the application to quit when the last CanvasWindow is closed by the user...
Definition: PyApp.cxx:383
static PyApp * instance()
Returns the application instance.
Definition: PyApp.cxx:249
A class to interface Python to application running in separate thread.
Definition: PyApp.h:32
bool hasTerminated() const
Returns true if the application as terminated, otherwise returns false.
Definition: PyApp.cxx:269
HdThread * m_thread
The thread in which to run the GUI.
Definition: PyApp.h:43
static void unlock()
Releases the lock on the application&#39;s mutex.
Definition: PyApp.cxx:357
PyApp()
The default Constructor.
Definition: PyApp.cxx:153
static bool locked()
returns true if the Application mutex is locked by different thread.
Definition: PyApp.cxx:344
static QtApp * s_app
The QApplication object.
Definition: PyApp.h:40
void openDocument(const std::string &filename)
Opens a new document from file filename.
Definition: PyApp.cxx:319
static PyApp * s_instance
The instance of the application.
Definition: PyApp.h:37

Generated for HippoDraw Class Library by doxygen