annotate libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h @ 18661:8b9e99c061f9 gui-release

GUI: Windows GUI terminal support for double click (Bug #41468) * libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h, libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp (QConsolePrivate::selectWord): New function. (QConsolePrivate::selectLine): New function. (QWinTerminalImpl::QWinTerminalImpl): init new allowTripleClick variable. (QWinTerminalImpl::mousePressEvent): call mouseTripleClickEvent ifallowTripleClick is set. (QWinTerminalImpl::mouseReleaseEvent): only process if settingSelection is true. (QWinTerminalImpl::mouseDoubleClickEvent): New function. (QWinTerminalImpl::mouseTripleClickEvent): New function. (QWinTerminalImpl::tripleClickTimeout): New slot.
author John Donoghue <john.donoghue@ieee.org>
date Fri, 18 Apr 2014 15:04:39 -0400
parents 41489b96ebca
children
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 /*
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
2
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 17264
diff changeset
3 Copyright (C) 2011, 2013 Michael Goffioul.
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
4
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
5 This file is part of QConsole.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
6
17795
0a8c35ae5ce1 maint: Fix various problems with GPL copyright statements.
Rik <rik@octave.org>
parents: 17744
diff changeset
7 This program is free software: you can redistribute it and/or modify
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
10 (at your option) any later version.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
11
17795
0a8c35ae5ce1 maint: Fix various problems with GPL copyright statements.
Rik <rik@octave.org>
parents: 17744
diff changeset
12 This program is distributed in the hope that it will be useful,
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
15 GNU General Public License for more details.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
16
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
17795
0a8c35ae5ce1 maint: Fix various problems with GPL copyright statements.
Rik <rik@octave.org>
parents: 17744
diff changeset
18 along with this program. If not,
0a8c35ae5ce1 maint: Fix various problems with GPL copyright statements.
Rik <rik@octave.org>
parents: 17744
diff changeset
19 see <http://www.gnu.org/licenses/>.
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
20
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
21 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23 #ifndef __QConsole_h__
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24 #define __QConsole_h__ 1
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
26 #include <QWidget>
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16620
diff changeset
27 #include "QTerminal.h"
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
28 class QFocusEvent;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29 class QKeyEvent;
16608
739d7eb97b85 make blinking cursor and different cursor styles for Windows GUI terminal
John W. Eaton <jwe@octave.org>
parents: 15681
diff changeset
30 class QPainter;
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
31 class QPaintEvent;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32 class QResizeEvent;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
33 class QWheelEvent;
16612
dae674adf045 handle text selection in GUI terminal for Windows
John W. Eaton <jwe@octave.org>
parents: 16608
diff changeset
34 class QPoint;
18655
41489b96ebca GUI: allow drag and drop to win32 GUI command window (Bug #41443)
John Donoghue <john.donoghue@ieee.org>
parents: 18610
diff changeset
35 class QDragEnterEvent;
41489b96ebca GUI: allow drag and drop to win32 GUI command window (Bug #41443)
John Donoghue <john.donoghue@ieee.org>
parents: 18610
diff changeset
36 class QDropEvent;
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
37
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
38 class QConsolePrivate;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39 class QConsoleThread;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
40 class QConsoleView;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
41
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
42 //////////////////////////////////////////////////////////////////////////////
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
43
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16620
diff changeset
44 class QWinTerminalImpl : public QTerminal
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
45 {
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
46 Q_OBJECT
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
47 friend class QConsolePrivate;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
48 friend class QConsoleThread;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
49 friend class QConsoleView;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
50
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
51 public:
15658
eaa7da75d202 Added QTerminalInteface class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15652
diff changeset
52 QWinTerminalImpl (QWidget* parent = 0);
eaa7da75d202 Added QTerminalInteface class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15652
diff changeset
53 QWinTerminalImpl (const QString& cmd, QWidget* parent = 0);
eaa7da75d202 Added QTerminalInteface class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15652
diff changeset
54 ~QWinTerminalImpl (void);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
55
15662
5758e0013246 Enable compilation on Win32-native platform.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15658
diff changeset
56 void setTerminalFont (const QFont& font);
5758e0013246 Enable compilation on Win32-native platform.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15658
diff changeset
57 void setSize (int columns, int lines);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
58 void sendText (const QString& s);
16608
739d7eb97b85 make blinking cursor and different cursor styles for Windows GUI terminal
John W. Eaton <jwe@octave.org>
parents: 15681
diff changeset
59 void setCursorType (CursorType type, bool blinking);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
60
16620
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16612
diff changeset
61 void setBackgroundColor (const QColor& color);
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16612
diff changeset
62 void setForegroundColor (const QColor& color);
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16612
diff changeset
63 void setSelectionColor (const QColor& color);
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16612
diff changeset
64 void setCursorColor (bool useForegoundColor, const QColor& color);
18610
6e81b59d657c Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents: 18555
diff changeset
65 void setScrollBufferSize(int value);
16620
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16612
diff changeset
66
16794
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16639
diff changeset
67 QString selectedText ();
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16639
diff changeset
68
15662
5758e0013246 Enable compilation on Win32-native platform.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15658
diff changeset
69 public slots:
5758e0013246 Enable compilation on Win32-native platform.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15658
diff changeset
70 void copyClipboard (void);
5758e0013246 Enable compilation on Win32-native platform.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15658
diff changeset
71 void pasteClipboard (void);
18555
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17795
diff changeset
72 void selectAll (void);
16608
739d7eb97b85 make blinking cursor and different cursor styles for Windows GUI terminal
John W. Eaton <jwe@octave.org>
parents: 15681
diff changeset
73 void blinkCursorEvent (void);
15662
5758e0013246 Enable compilation on Win32-native platform.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15658
diff changeset
74
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
75 signals:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
76 void terminated (void);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
77 void titleChanged (const QString&);
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16794
diff changeset
78 void set_global_shortcuts_signal (bool);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
79
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
80 protected:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
81 void viewPaintEvent (QConsoleView*, QPaintEvent*);
16608
739d7eb97b85 make blinking cursor and different cursor styles for Windows GUI terminal
John W. Eaton <jwe@octave.org>
parents: 15681
diff changeset
82 void setBlinkingCursor (bool blink);
739d7eb97b85 make blinking cursor and different cursor styles for Windows GUI terminal
John W. Eaton <jwe@octave.org>
parents: 15681
diff changeset
83 void setBlinkingCursorState (bool blink);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
84 void viewResizeEvent (QConsoleView*, QResizeEvent*);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
85 void wheelEvent (QWheelEvent*);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
86 void focusInEvent (QFocusEvent*);
16608
739d7eb97b85 make blinking cursor and different cursor styles for Windows GUI terminal
John W. Eaton <jwe@octave.org>
parents: 15681
diff changeset
87 void focusOutEvent (QFocusEvent*);
739d7eb97b85 make blinking cursor and different cursor styles for Windows GUI terminal
John W. Eaton <jwe@octave.org>
parents: 15681
diff changeset
88 void keyPressEvent (QKeyEvent*);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
89 virtual void start (void);
16612
dae674adf045 handle text selection in GUI terminal for Windows
John W. Eaton <jwe@octave.org>
parents: 16608
diff changeset
90 void mouseMoveEvent (QMouseEvent *event);
dae674adf045 handle text selection in GUI terminal for Windows
John W. Eaton <jwe@octave.org>
parents: 16608
diff changeset
91 void mousePressEvent (QMouseEvent *event);
dae674adf045 handle text selection in GUI terminal for Windows
John W. Eaton <jwe@octave.org>
parents: 16608
diff changeset
92 void mouseReleaseEvent (QMouseEvent *event);
18661
8b9e99c061f9 GUI: Windows GUI terminal support for double click (Bug #41468)
John Donoghue <john.donoghue@ieee.org>
parents: 18655
diff changeset
93 void mouseDoubleClickEvent (QMouseEvent* event);
8b9e99c061f9 GUI: Windows GUI terminal support for double click (Bug #41468)
John Donoghue <john.donoghue@ieee.org>
parents: 18655
diff changeset
94 void mouseTripleClickEvent (QMouseEvent* event);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
95
17264
aa09b746fa16 Windows GUI: Reimplement tabbing in terminal window
John Donoghue <john.donoghue@ieee.org>
parents: 17248
diff changeset
96 bool eventFilter(QObject *obj, QEvent *ev);
aa09b746fa16 Windows GUI: Reimplement tabbing in terminal window
John Donoghue <john.donoghue@ieee.org>
parents: 17248
diff changeset
97
18655
41489b96ebca GUI: allow drag and drop to win32 GUI command window (Bug #41443)
John Donoghue <john.donoghue@ieee.org>
parents: 18610
diff changeset
98 void dragEnterEvent(QDragEnterEvent *event);
41489b96ebca GUI: allow drag and drop to win32 GUI command window (Bug #41443)
John Donoghue <john.donoghue@ieee.org>
parents: 18610
diff changeset
99 void dropEvent(QDropEvent *event);
41489b96ebca GUI: allow drag and drop to win32 GUI command window (Bug #41443)
John Donoghue <john.donoghue@ieee.org>
parents: 18610
diff changeset
100
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
101 private slots:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
102 void scrollValueChanged (int value);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
103 void monitorConsole (void);
16612
dae674adf045 handle text selection in GUI terminal for Windows
John W. Eaton <jwe@octave.org>
parents: 16608
diff changeset
104 void updateSelection (void);
18661
8b9e99c061f9 GUI: Windows GUI terminal support for double click (Bug #41468)
John Donoghue <john.donoghue@ieee.org>
parents: 18655
diff changeset
105 void tripleClickTimeout (void);
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
106
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
107 private:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
108 QConsolePrivate* d;
18661
8b9e99c061f9 GUI: Windows GUI terminal support for double click (Bug #41468)
John Donoghue <john.donoghue@ieee.org>
parents: 18655
diff changeset
109 bool allowTripleClick;
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
110 };
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
111
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
112 //////////////////////////////////////////////////////////////////////////////
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
113
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
114 #endif // __QConsole_h__