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
30 std::queue<struct queue_data> outbuf;
31 eSocketNotifier *in, *out, *err;
32 void readyRead(int what);
33 void readyErrRead(int what);
34 void readyWrite(int what);
38 eConsoleAppContainer();
39 int setCWD( const char *path );
40 int execute( const char *str );
41 int execute( const char *cmdline, const char *const argv[] );
42 int execute( PyObject *cmdline, PyObject *args );
43 ~eConsoleAppContainer();
44 int getPID() { return pid; }
47 void write( const char *data, int len );
48 void write( PyObject *data );
49 bool running() { return (fd[0]!=-1) && (fd[1]!=-1) && (fd[2]!=-1); }
50 PSignal1<void, const char*> dataAvail;
51 PSignal1<void,int> dataSent;
52 PSignal1<void,int> appClosed;
55 #endif // __LIB_BASE_CONSOLE_H__