summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/MyPty.h
authorzecke <zecke>2002-10-14 22:58:11 (UTC)
committer zecke <zecke>2002-10-14 22:58:11 (UTC)
commitd7290c6b24266303abd95e7f38c0fecae395f355 (patch) (side-by-side diff)
treef8202b056d9ae8de1cfa818de60ff2929c520f90 /noncore/apps/opie-console/MyPty.h
parentf5d1ce4b3887e0f09704abad5b9414c9cd90be4b (diff)
downloadopie-d7290c6b24266303abd95e7f38c0fecae395f355.zip
opie-d7290c6b24266303abd95e7f38c0fecae395f355.tar.gz
opie-d7290c6b24266303abd95e7f38c0fecae395f355.tar.bz2
A small console emulation layer...
And some configuration stuff fonts are working colors are not fully working BackGround and ForeGround both are black :(
Diffstat (limited to 'noncore/apps/opie-console/MyPty.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/MyPty.h b/noncore/apps/opie-console/MyPty.h
new file mode 100644
index 0000000..9231a8a
--- a/dev/null
+++ b/noncore/apps/opie-console/MyPty.h
@@ -0,0 +1,95 @@
+/* -------------------------------------------------------------------------- */
+/* */
+/* [MyPty.h] Pseudo Terminal Device */
+/* */
+/* -------------------------------------------------------------------------- */
+/* */
+/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
+/* */
+/* This file is part of Konsole - an X terminal for KDE */
+/* */
+/* -------------------------------------------------------------------------- */
+/* */
+/* Ported Konsole to Qt/Embedded */
+/* */
+/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
+/* */
+/* -------------------------------------------------------------------------- */
+
+/*! \file
+*/
+
+#ifndef MY_PTY_H
+#define MY_PTY_H
+
+#include <qobject.h>
+#include <qstrlist.h>
+
+#include "io_layer.h"
+
+class Profile;
+class MyPty : public IOLayer
+{
+ Q_OBJECT
+public:
+
+ MyPty(const Profile&);
+ ~MyPty();
+
+
+
+ QString identifier()const;
+ QString name()const;
+
+ public slots:
+ /*!
+ having a `run' separate from the constructor allows to make
+ the necessary connections to the signals and slots of the
+ instance before starting the execution of the client.
+ */
+ void start();
+ int run(const char* pgm, QStrList & args , const char* term, int addutmp);
+ bool open();
+ void close();
+ void reload( const Profile& );
+ void setSize(int lines, int columns);
+ void error();
+
+ signals:
+
+ /*!
+ emitted when the client program terminates.
+ \param status the wait(2) status code of the terminated client 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 received(const QByteArray&);
+
+ public slots:
+
+ void send(const QByteArray& );
+
+private:
+ const char* deviceName();
+
+protected slots:
+ void readPty();
+ void donePty();
+
+private:
+ int openPty();
+
+private:
+
+ char m_ptynam[16]; // "/dev/ptyxx" | "/dev/ptmx"
+ char m_ttynam[16]; // "/dev/ttyxx" | "/dev/pts/########..."
+ int m_fd;
+ int m_cpid;
+};
+
+#endif