2 #include "MainWindow.h"
3 #include "misc/String.h"
8 Program::Program(std::string executable
, std::string arguments
, bool in_xterm
)
9 : executable(executable
), arguments(arguments
), in_xterm(in_xterm
) {
12 arguments
= "-e " + executable
+ " " + arguments
;
13 executable
= "/usr/bin/x-terminal-emulator";
16 arguments
= Misc::StreamAsString() << "--gui-pid " << getpid() << " " << executable
<< " " << arguments
;
17 executable
= "/home/strange/c/aesalon/aesalon"; /* NOTE: hardcoded . . . */
19 Platform::ArgumentList argument_list
;
21 Misc::SmartPointer
<Platform::NamedPipe
> gui_pipe
22 = new Aesalon::Platform::NamedPipe(Aesalon::Platform::NamedPipe::READ_PIPE
, Misc::StreamAsString() << "/tmp/aesalon_gui-" << getpid(), true);
24 argument_list
.from_string(arguments
);
26 bi_pipe
= new Platform::BidirectionalPipe(executable
, argument_list
, true);
29 while((data
= gui_pipe
->get_data()) == "") ;
33 std::size_t aesalon_pid
= 0;
35 Misc::String::to
<std::size_t>(data
, aesalon_pid
);
37 memory
= new Platform::Memory();
38 named_pipe
= new Platform::NamedPipe(Aesalon::Platform::NamedPipe::READ_PIPE
, Misc::StreamAsString() << "/tmp/aesalon-" << aesalon_pid
);
42 } // namespace Aesalon