1 #ifndef __LIB_BASE_CONSOLE_H__
2 #define __LIB_BASE_CONSOLE_H__
6 #include <lib/base/ebase.h>
7 #include <lib/python/connections.h>
13 queue_data( char *data, int len )
14 :data(data), len(len), dataSent(0)
23 class eConsoleAppContainer: public Object
31 std::queue<struct queue_data> outbuf;
32 eSocketNotifier *in, *out, *err;
33 void readyRead(int what);
34 void readyErrRead(int what);
35 void readyWrite(int what);
39 eConsoleAppContainer();
40 int setCWD( const char *path );
41 int execute( const char *str );
42 int execute( const char *cmdline, const char *const argv[] );
43 int execute( PyObject *cmdline, PyObject *args );
44 ~eConsoleAppContainer();
45 int getPID() { return pid; }
48 void write( const char *data, int len );
49 void write( PyObject *data );
50 void readFromFile( PyObject *py_filename );
51 void dumpToFile( PyObject *py_filename );
52 bool running() { return (fd[0]!=-1) && (fd[1]!=-1) && (fd[2]!=-1); }
53 PSignal1<void, const char*> dataAvail;
54 PSignal1<void, const char*> stdoutAvail;
55 PSignal1<void, const char*> stderrAvail;
56 PSignal1<void,int> dataSent;
57 PSignal1<void,int> appClosed;
60 #endif // __LIB_BASE_CONSOLE_H__