diff options
author | Ken Moore <moorekou@gmail.com> | 2016-03-09 16:28:37 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-03-09 16:28:37 -0500 |
commit | c741f4853592c5901ff60711236a5e732514abd4 (patch) | |
tree | 9f00dcc728f1ef53a4655dbfac00b5f352cf8f1d /desktop-utilities/lumina-terminal/TtyProcess.h | |
parent | Get a bunch more of the lumina-terminal app written up. Still not quite done ... (diff) | |
download | lumina-c741f4853592c5901ff60711236a5e732514abd4.tar.gz lumina-c741f4853592c5901ff60711236a5e732514abd4.tar.bz2 lumina-c741f4853592c5901ff60711236a5e732514abd4.zip |
Oops, forgot to add the new TtyProcess files in the last commit.
Diffstat (limited to 'desktop-utilities/lumina-terminal/TtyProcess.h')
-rw-r--r-- | desktop-utilities/lumina-terminal/TtyProcess.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/desktop-utilities/lumina-terminal/TtyProcess.h b/desktop-utilities/lumina-terminal/TtyProcess.h new file mode 100644 index 00000000..c764b5ae --- /dev/null +++ b/desktop-utilities/lumina-terminal/TtyProcess.h @@ -0,0 +1,43 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2015, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +// This is basically a replacement for QProcess, where all process/terminal outputs +// are redirected and not just the standard input/output channels. This allows it +// to be used for terminal-like apps (shells) which directly modify the terminal output +// rather than stick to input/output channels for communication. +//=========================================== +#ifndef _LUMINA_DESKTOP_UTILITIES_TERMINAL_TTY_PROCESS_WIDGET_H +#define _LUMINA_DESKTOP_UTILITIES_TERMINAL_TTY_PROCESS_WIDGET_H + +#include <QSerialPort> +#include <QDebug> + +class TTYProcess : public QSerialPort{ + Q_OBJECT +public: + TTYProcess(QObject *parent = 0); + ~TTYProcess(); + + bool start(QString prog, QStringList args = QStringList()); + +private: + pid_t childProc; + + //==================================== + // C Library function for setting up the PTY + // Inputs: + // int &fd: (output) file descriptor for the master PTY (positive integer if valid) + // char *prog: program to run + // char **args: program arguments + // Returns: + // -1 for errors, child process PID (positive integer) if successful + //==================================== + static pid_t LaunchProcess(int& fd, char *prog, char **child_args); + + +}; + +#endif
\ No newline at end of file |