b491fd6378
handled. Use the UnixSignalHandler to detect terminal resizing. The client doesn't do anything with the terminal size yet. It should send the size to the server.
44 lines
871 B
C++
44 lines
871 B
C++
#ifndef UNIXCLIENT_H
|
|
#define UNIXCLIENT_H
|
|
|
|
#include <QObject>
|
|
#include <QByteArray>
|
|
#include <termios.h>
|
|
|
|
class QSocketNotifier;
|
|
class QTcpSocket;
|
|
|
|
class UnixClient : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit UnixClient(QTcpSocket *socket, QObject *parent = 0);
|
|
virtual ~UnixClient();
|
|
|
|
private:
|
|
static termios setRawTerminalMode();
|
|
static void restoreTerminalMode(termios original);
|
|
|
|
signals:
|
|
|
|
private slots:
|
|
void terminalResized();
|
|
void socketDisconnected();
|
|
void terminalReadActivated();
|
|
void socketBytesWritten();
|
|
void socketReadyRead();
|
|
void terminalWriteActivated();
|
|
void doServerToClient();
|
|
|
|
public slots:
|
|
|
|
private:
|
|
termios savedTermios;
|
|
QSocketNotifier *terminalReadNotifier;
|
|
QSocketNotifier *terminalWriteNotifier;
|
|
QTcpSocket *socket;
|
|
QByteArray terminalWriteBuffer;
|
|
};
|
|
|
|
#endif // UNIXCLIENT_H
|