Refine "View Code" command.
[kdbg.git] / kdbg / ttywnd.h
blob3995ffc791d1d1eb544bdad829c9215f21506884
1 /*
2 * Copyright Johannes Sixt
3 * This file is licensed under the GNU General Public License Version 2.
4 * See the file COPYING in the toplevel directory of the source directory.
5 */
7 #ifndef TTYWND_H
8 #define TTYWND_H
10 #include <qtextedit.h>
12 class QSocketNotifier;
13 class QPopupMenu;
15 /**
16 * This class is cortesy Judin Max <novaprint@mtu-net.ru>.
18 * The master side of the TTY is the emulator.
20 * The slave side is where a client process can write output and can read
21 * input. For this purpose, it must open the file (terminal device) whose
22 * name is returned by @ref slaveTTY for both reading and writing. To
23 * establish the stdin, stdout, and stderr channels the file descriptor
24 * obtained by this must be dup'd to file descriptors 0, 1, and 2, resp.
26 class STTY : public QObject
28 Q_OBJECT
29 public:
30 STTY();
31 ~STTY();
33 QString slaveTTY(){ return m_slavetty; };
35 protected slots:
36 void outReceived(int);
38 signals:
39 void output(char* buffer, int charlen);
41 protected:
42 int m_masterfd;
43 int m_slavefd;
44 QSocketNotifier* m_outNotifier;
45 QString m_slavetty;
46 bool findTTY();
49 class TTYWindow : public QTextEdit
51 Q_OBJECT
52 public:
53 TTYWindow(QWidget* parent, const char* name);
54 ~TTYWindow();
56 QString activate();
57 void deactivate();
59 protected:
60 STTY* m_tty;
61 virtual QPopupMenu* createPopupMenu(const QPoint& pos);
62 int m_hPos; //!< tracks horizontal cursor position
64 protected slots:
65 void slotAppend(char* buffer, int count);
66 void slotClear();
69 #endif // TTYWND_H