1 #ifndef __LIB_BASE_CONSOLE_H__
2 #define __LIB_BASE_CONSOLE_H__
5 #include <lib/base/ebase.h>
6 #include <lib/python/connections.h>
11 queue_data( char *data, int len )
12 :data(data), len(len), dataSent(0)
20 class eConsoleAppContainer: public Object, public iObject
22 DECLARE_REF(eConsoleAppContainer);
28 std::queue<struct queue_data> outbuf;
29 ePtr<eSocketNotifier> in, out, err;
30 void readyRead(int what);
31 void readyErrRead(int what);
32 void readyWrite(int what);
35 eConsoleAppContainer();
36 ~eConsoleAppContainer();
37 int setCWD( const char *path );
38 int execute( const char *str );
39 int execute( const char *cmdline, const char *const argv[] );
40 int getPID() { return pid; }
44 void write( const char *data, int len );
45 void setFileFD(int num, int fd) { if (num >= 0 && num <= 2) filefd[num] = fd; }
46 bool running() { return (fd[0]!=-1) && (fd[1]!=-1) && (fd[2]!=-1); }
47 PSignal1<void, const char*> dataAvail;
48 PSignal1<void, const char*> stdoutAvail;
49 PSignal1<void, const char*> stderrAvail;
50 PSignal1<void,int> dataSent;
51 PSignal1<void,int> appClosed;
54 #endif // __LIB_BASE_CONSOLE_H__