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