Diffstat (limited to 'noncore/apps/opie-console/MyPty.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/MyPty.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/MyPty.h b/noncore/apps/opie-console/MyPty.h index 7561ca3..b292ce4 100644 --- a/noncore/apps/opie-console/MyPty.h +++ b/noncore/apps/opie-console/MyPty.h | |||
@@ -2,52 +2,55 @@ | |||
2 | /* */ | 2 | /* */ |
3 | /* [MyPty.h] Pseudo Terminal Device */ | 3 | /* [MyPty.h] Pseudo Terminal Device */ |
4 | /* */ | 4 | /* */ |
5 | /* -------------------------------------------------------------------------- */ | 5 | /* -------------------------------------------------------------------------- */ |
6 | /* */ | 6 | /* */ |
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* -------------------------------------------------------------------------- */ | 11 | /* -------------------------------------------------------------------------- */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | 18 | ||
19 | /*! \file | 19 | /*! \file |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #ifndef MY_PTY_H | 22 | #ifndef MY_PTY_H |
23 | #define MY_PTY_H | 23 | #define MY_PTY_H |
24 | 24 | ||
25 | #include <qobject.h> | 25 | #include <qobject.h> |
26 | #include <qlist.h> | ||
26 | #include <qstrlist.h> | 27 | #include <qstrlist.h> |
27 | 28 | ||
28 | #include "io_layer.h" | 29 | #include "io_layer.h" |
29 | 30 | ||
31 | typedef QMap<QString, QString> EnvironmentMap; | ||
32 | |||
30 | class Profile; | 33 | class Profile; |
31 | class QSocketNotifier; | 34 | class QSocketNotifier; |
32 | class MyPty : public IOLayer | 35 | class MyPty : public IOLayer |
33 | { | 36 | { |
34 | Q_OBJECT | 37 | Q_OBJECT |
35 | public: | 38 | public: |
36 | 39 | ||
37 | MyPty(const Profile&); | 40 | MyPty(const Profile&); |
38 | ~MyPty(); | 41 | ~MyPty(); |
39 | 42 | ||
40 | 43 | ||
41 | 44 | ||
42 | QString identifier()const; | 45 | QString identifier()const; |
43 | QString name()const; | 46 | QString name()const; |
44 | QBitArray supports()const; | 47 | QBitArray supports()const; |
45 | 48 | ||
46 | public slots: | 49 | public slots: |
47 | /*! | 50 | /*! |
48 | having a `run' separate from the constructor allows to make | 51 | having a `run' separate from the constructor allows to make |
49 | the necessary connections to the signals and slots of the | 52 | the necessary connections to the signals and slots of the |
50 | instance before starting the execution of the client. | 53 | instance before starting the execution of the client. |
51 | */ | 54 | */ |
52 | void start(); | 55 | void start(); |
53 | int run(const char* pgm, QStrList & args , const char* term, int addutmp); | 56 | int run(const char* pgm, QStrList & args , const char* term, int addutmp); |
@@ -74,27 +77,30 @@ public: | |||
74 | 77 | ||
75 | public slots: | 78 | public slots: |
76 | 79 | ||
77 | void send(const QByteArray& ); | 80 | void send(const QByteArray& ); |
78 | 81 | ||
79 | private: | 82 | private: |
80 | const char* deviceName(); | 83 | const char* deviceName(); |
81 | 84 | ||
82 | protected slots: | 85 | protected slots: |
83 | void readPty(); | 86 | void readPty(); |
84 | void donePty(); | 87 | void donePty(); |
85 | 88 | ||
86 | private: | 89 | private: |
87 | int openPty(); | 90 | int openPty(); |
88 | 91 | ||
89 | private: | 92 | private: |
90 | 93 | ||
91 | char m_ptynam[16]; // "/dev/ptyxx" | "/dev/ptmx" | 94 | char m_ptynam[16]; // "/dev/ptyxx" | "/dev/ptmx" |
92 | char m_ttynam[16]; // "/dev/ttyxx" | "/dev/pts/########..." | 95 | char m_ttynam[16]; // "/dev/ttyxx" | "/dev/pts/########..." |
93 | int m_fd; | 96 | int m_fd; |
94 | int m_cpid; | 97 | int m_cpid; |
95 | QSocketNotifier* m_sn_e; | 98 | QSocketNotifier* m_sn_e; |
96 | QSocketNotifier* m_sn_r; | 99 | QSocketNotifier* m_sn_r; |
97 | char* m_term; | 100 | char* m_term; |
101 | |||
102 | QString m_cmd; | ||
103 | EnvironmentMap m_env; | ||
98 | }; | 104 | }; |
99 | 105 | ||
100 | #endif | 106 | #endif |