Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MyPty.h

Go to the documentation of this file.
00001 /* -------------------------------------------------------------------------- */
00002 /*                                                                            */
00003 /* [MyPty.h]                 Pseudo Terminal Device                           */
00004 /*                                                                            */
00005 /* -------------------------------------------------------------------------- */
00006 /*                                                                            */
00007 /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de>            */
00008 /*                                                                            */
00009 /* This file is part of Konsole - an X terminal for KDE                       */
00010 /*                                                                            */
00011 /* -------------------------------------------------------------------------- */
00012 /*                                                                            */
00013 /* Ported Konsole to Qt/Embedded                                              */
00014 /*                                                                            */
00015 /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com>                  */
00016 /*                                                                            */
00017 /* -------------------------------------------------------------------------- */
00018 
00022 #ifndef MY_PTY_H
00023 #define MY_PTY_H
00024 
00025 #include <qobject.h>
00026 #include <qstrlist.h>
00027 
00028 
00029 class MyPty : public QObject
00030 {
00031 Q_OBJECT
00032 
00033   public:
00034 
00035     MyPty();
00036     ~MyPty();
00037 
00043     int run(const char* pgm, QStrList & args, const char* term, int addutmp);
00044 
00045   public slots:
00046 
00047     void send_bytes(const char* s, int len);
00048     void setSize(int lines, int columns);
00049     void error();
00050 
00051   signals:
00052 
00057     void done(int status);
00058 
00064     void block_in(const char* s, int len);
00065 
00066   public:
00067 
00068     void send_byte(char s);
00069 //    void send_string(const char* s);
00070 
00071     const char* deviceName();
00072 
00073   protected slots:
00074       void readPty();
00075       void donePty();
00076       
00077   private:
00078     int  openPty();
00079 
00080   private:
00081 
00082     char ptynam[16]; // "/dev/ptyxx" | "/dev/ptmx"
00083     char ttynam[16]; // "/dev/ttyxx" | "/dev/pts/########..."
00084     int fd;
00085     int cpid;
00086 };
00087 
00088 #endif

Generated on Sat Nov 5 16:15:26 2005 for OPIE by  doxygen 1.4.2