GNU Octave  8.1.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 fdstdin;
35  int fdstdout;
36  int fdstderr;
37 
38 public:
39  QUnixTerminalImpl(octave::base_qobject&, QWidget *parent);
40  virtual ~QUnixTerminalImpl();
41 
42  void setTerminalFont(const QFont &font);
43  void setSize(int h, int v);
44  void sendText(const QString& text);
45 
46  void setCursorType(CursorType type, bool blinking);
47 
48  void setBackgroundColor (const QColor& color);
49  void setForegroundColor (const QColor& color);
50  void setSelectionColor (const QColor& color);
51  void setCursorColor (bool useForegroundColor, const QColor& color);
52  void setScrollBufferSize(int value);
53  QString selectedText();
54  void has_extra_interrupt (bool extra_interrupt);
55  QList<QAction*> get_hotspot_actions (const QPoint& at);
56 
57 public slots:
58  void copyClipboard();
59  void pasteClipboard();
60  void selectAll();
61  virtual void handle_visibility_changed (bool visible);
62 
63 protected:
64  void showEvent(QShowEvent *);
65  virtual void resizeEvent(QResizeEvent *);
66 
67 private:
68  void initialize ();
69  void connectToPty();
70 
75 };
76 
77 #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)
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 *)
QUnixTerminalImpl(octave::base_qobject &, QWidget *parent)
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