annotate libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h @ 19628:fe689210525c gui-release

maint: Periodic merge of stable to gui-release.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Jan 2015 10:05:42 -0500
parents 6e81b59d657c 446c46af4b42
children 0e1f5a750d00
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
1 /* Copyright (C) 2008 e_k (e_k@users.sourceforge.net)
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 16794
diff changeset
2 Copyright (C) 2012-2013 Jacob Dawid <jacob.dawid@googlemail.com>
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
3
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
4 This library is free software; you can redistribute it and/or
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
5 modify it under the terms of the GNU Library General Public
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
6 License as published by the Free Software Foundation; either
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
7 version 2 of the License, or (at your option) any later version.
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
8
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
9 This library is distributed in the hope that it will be useful,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
12 Library General Public License for more details.
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
13
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
14 You should have received a copy of the GNU Library General Public License
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
15 along with this library; see the file COPYING.LIB. If not, write to
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
17 Boston, MA 02110-1301, USA.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
18 */
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
19
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
20
15658
eaa7da75d202 Added QTerminalInteface class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15656
diff changeset
21 #ifndef Q_UNIXTERMINALIMPL
eaa7da75d202 Added QTerminalInteface class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15656
diff changeset
22 #define Q_UNIXTERMINALIMPL
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24 #include <QtGui>
15653
35c891dce299 Removed INCLUDEPATH.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15651
diff changeset
25 #include "unix/kpty.h"
35c891dce299 Removed INCLUDEPATH.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15651
diff changeset
26 #include "unix/TerminalModel.h"
35c891dce299 Removed INCLUDEPATH.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15651
diff changeset
27 #include "unix/TerminalView.h"
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16620
diff changeset
28 #include "QTerminal.h"
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16620
diff changeset
30 class QUnixTerminalImpl : public QTerminal
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
31 {
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32 Q_OBJECT
16484
fa842e78f491 Restore STDERR stream pipe before exit to capture error messages.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15681
diff changeset
33
fa842e78f491 Restore STDERR stream pipe before exit to capture error messages.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15681
diff changeset
34 int fdstderr;
fa842e78f491 Restore STDERR stream pipe before exit to capture error messages.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15681
diff changeset
35
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
36 public:
15658
eaa7da75d202 Added QTerminalInteface class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15656
diff changeset
37 QUnixTerminalImpl(QWidget *parent = 0);
eaa7da75d202 Added QTerminalInteface class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15656
diff changeset
38 virtual ~QUnixTerminalImpl();
16484
fa842e78f491 Restore STDERR stream pipe before exit to capture error messages.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15681
diff changeset
39
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
40 void setTerminalFont(const QFont &font);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
41 void setSize(int h, int v);
15662
5758e0013246 Enable compilation on Win32-native platform.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15659
diff changeset
42 void sendText(const QString& text);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
43
15677
f620ecde2566 Added support for changing the cursor.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 15662
diff changeset
44 void setCursorType(CursorType type, bool blinking);
f620ecde2566 Added support for changing the cursor.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 15662
diff changeset
45
16620
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16609
diff changeset
46 void setBackgroundColor (const QColor& color);
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16609
diff changeset
47 void setForegroundColor (const QColor& color);
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16609
diff changeset
48 void setSelectionColor (const QColor& color);
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16609
diff changeset
49 void setCursorColor (bool useForegroundColor, const QColor& color);
18644
6e81b59d657c Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents: 18568
diff changeset
50 void setScrollBufferSize(int value);
16794
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16639
diff changeset
51 QString selectedText();
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16639
diff changeset
52
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
53 public slots:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
54 void copyClipboard();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
55 void pasteClipboard();
18568
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17744
diff changeset
56 void selectAll();
16484
fa842e78f491 Restore STDERR stream pipe before exit to capture error messages.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15681
diff changeset
57
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
58 protected:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
59 void showEvent(QShowEvent *);
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
60 virtual void resizeEvent(QResizeEvent *);
16484
fa842e78f491 Restore STDERR stream pipe before exit to capture error messages.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15681
diff changeset
61
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
62 private:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
63 void initialize();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
64 void connectToPty();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
65
15659
739f0f73e772 Cleanup.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15658
diff changeset
66 TerminalView *m_terminalView;
739f0f73e772 Cleanup.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15658
diff changeset
67 TerminalModel *m_terminalModel;
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
68 KPty *m_kpty;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
69 };
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
70
15658
eaa7da75d202 Added QTerminalInteface class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15656
diff changeset
71 #endif // Q_UNIXTERMINALIMPL