GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
QUnixTerminalImpl.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 e_k (e_k@users.sourceforge.net)
2  Copyright (C) 2012-2019 Jacob Dawid <jacob.dawid@cybercatalyst.com>
3 
4  This library is free software: you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 
21 #ifndef Q_UNIXTERMINALIMPL
22 #define Q_UNIXTERMINALIMPL
23 
24 #include <QtGui>
25 #include "unix/kpty.h"
26 #include "unix/TerminalModel.h"
27 #include "unix/TerminalView.h"
28 #include "QTerminal.h"
29 
31 {
32  Q_OBJECT
33 
34  int fdstderr;
35 
36 public:
37  QUnixTerminalImpl(QWidget *parent = nullptr);
38  virtual ~QUnixTerminalImpl();
39 
40  void setTerminalFont(const QFont &font);
41  void setSize(int h, int v);
42  void sendText(const QString& text);
43 
44  void setCursorType(CursorType type, bool blinking);
45 
46  void setBackgroundColor (const QColor& color);
47  void setForegroundColor (const QColor& color);
48  void setSelectionColor (const QColor& color);
49  void setCursorColor (bool useForegroundColor, const QColor& color);
50  void setScrollBufferSize(int value);
51  QString selectedText();
52  void has_extra_interrupt (bool extra_interrupt);
53  QList<QAction*> get_hotspot_actions (const QPoint& at);
54 
55 public slots:
56  void copyClipboard();
57  void pasteClipboard();
58  void selectAll();
59  virtual void handle_visibility_changed (bool visible);
60 
61 protected:
62  void showEvent(QShowEvent *);
63  virtual void resizeEvent(QResizeEvent *);
64 
65 private:
66  void initialize();
67  void connectToPty();
68 
74 };
75 
76 #endif // Q_UNIXTERMINALIMPL
Provides primitives for opening & closing a pseudo TTY pair, assigning the controlling TTY,...
Definition: kpty.h:35
virtual void handle_visibility_changed(bool visible)
QUnixTerminalImpl(QWidget *parent=nullptr)
void sendText(const QString &text)
void setSelectionColor(const QColor &color)
void setTerminalFont(const QFont &font)
void setSize(int h, int v)
void setCursorType(CursorType type, bool blinking)
void setBackgroundColor(const QColor &color)
void has_extra_interrupt(bool extra_interrupt)
QList< QAction * > get_hotspot_actions(const QPoint &at)
void setCursorColor(bool useForegroundColor, const QColor &color)
TerminalModel * m_terminalModel
void setScrollBufferSize(int value)
void showEvent(QShowEvent *)
void setForegroundColor(const QColor &color)
TerminalView * m_terminalView
virtual void resizeEvent(QResizeEvent *)
Represents a terminal session consisting of a pseudo-teletype and a terminal emulation.
Definition: TerminalModel.h:57
A widget which displays output from a terminal emulation and sends input keypresses and mouse activit...
Definition: TerminalView.h:64