⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mypty.h

📁 Trolltech公司发布的图形界面操作系统。可在qt-embedded-2.3.7平台上编译为嵌入式图形界面操作系统。
💻 H
字号:
/* -------------------------------------------------------------------------- *//*                                                                            *//* [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 <qglobal.h>#include <qobject.h>#include <qstrlist.h>#if defined (_OS_WIN32_)#include "../../../server/qprocess.h"#include <qarray.h>#endifclass MyPty : public QObject{Q_OBJECT  public:    MyPty();    ~MyPty();    /*        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.    */    int run(const char* pgm, QStrList & args, const char* term, int addutmp);  public slots:    void send_bytes(const char* s, int len);    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 block_in(const char* s, int len);  public:    void send_byte(char s);//    void send_string(const char* s);    const char* deviceName();  protected slots:      void readPty();      void donePty();        private:    int  openPty();  private:#if !defined (_OS_WIN32_)    char ptynam[16]; // "/dev/ptyxx" | "/dev/ptmx"    char ttynam[16]; // "/dev/ttyxx" | "/dev/pts/########..."    int fd;    int cpid;#else    QProcess terminalProcess;    QByteArray stdInBuffer;#endif};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -