Files
konsole/include/TEShell.h
Alex Zepeda c766916ae2 Make this compile. sys/types.h can be a good thing.
svn path=/trunk/kdebase/konsole/; revision=23759
1999-06-17 08:15:18 +00:00

94 lines
2.4 KiB
C++

/* -------------------------------------------------------------------------- */
/* */
/* [Shell.h] Shell */
/* */
/* -------------------------------------------------------------------------- */
/* */
/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
/* */
/* This file is part of Konsole - an X terminal for KDE */
/* */
/* -------------------------------------------------------------------------- */
/*! \file
*/
#ifndef SHELL_H
#define SHELL_H
#include <sys/types.h>
#include <qobject.h>
#include <termios.h>
#include <qsocketnotifier.h>
#include <qtimer.h>
#include <qstrlist.h>
/* ---| Shell Parameters |--------------------------------------------------- */
//FIXME: clean this up!
class Shell: public QObject
{
Q_OBJECT
public:
Shell(int login_shell);
~Shell();
public:
int run(QStrList & args, const char* term);
public:
/*! this is of internal use only. FIXME: make private */
void doneShell(int status);
void kill(int signal);
public:
void send_byte(char s);
void send_string(const char* s);
public slots:
void send_bytes(const char* s, int len);
signals:
/*!
emitted when the shell instance terminates.
\param status the wait(2) status code of the terminated child program.
*/
void done(int status);
/*!
emitted when a new block of data comes in.
\param s - the data
\param len - the length of the block
*/
void block_in(const char* s, int len);
private slots:
void DataReceived(int);
public slots:
void setSize(int lines, int columns);
private:
void makeShell(const char* dev, QStrList & args, const char* term);
int openShell();
private:
int fd;
pid_t comm_pid;
int login_shell;
QSocketNotifier* mn;
bool needGrantPty;
char ptynam[50]; // "/dev/ptyxx" | "/dev/ptmx"
char ttynam[50]; // "/dev/ttyxx" | "/dev/pts/########..."
};
#endif