Convert KActions to QActions.
[kdbg.git] / kdbg / ttywnd.h
blobe54e1e1578d845c2963af57b14357c0e04b22223
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 <q3textedit.h>
11 #include <Q3PopupMenu>
13 class QSocketNotifier;
14 class Q3PopupMenu;
16 /**
17 * This class is cortesy Judin Max <novaprint@mtu-net.ru>.
19 * The master side of the TTY is the emulator.
21 * The slave side is where a client process can write output and can read
22 * input. For this purpose, it must open the file (terminal device) whose
23 * name is returned by @ref slaveTTY for both reading and writing. To
24 * establish the stdin, stdout, and stderr channels the file descriptor
25 * obtained by this must be dup'd to file descriptors 0, 1, and 2, resp.
27 class STTY : public QObject
29 Q_OBJECT
30 public:
31 STTY();
32 ~STTY();
34 QString slaveTTY(){ return m_slavetty; };
36 protected slots:
37 void outReceived(int);
39 signals:
40 void output(char* buffer, int charlen);
42 protected:
43 int m_masterfd;
44 int m_slavefd;
45 QSocketNotifier* m_outNotifier;
46 QString m_slavetty;
47 bool findTTY();
50 class TTYWindow : public Q3TextEdit
52 Q_OBJECT
53 public:
54 TTYWindow(QWidget* parent);
55 ~TTYWindow();
57 QString activate();
58 void deactivate();
60 protected:
61 STTY* m_tty;
62 virtual Q3PopupMenu* createPopupMenu(const QPoint& pos);
63 int m_hPos; //!< tracks horizontal cursor position
65 protected slots:
66 void slotAppend(char* buffer, int count);
67 void slotClear();
70 #endif // TTYWND_H