Changeset View
Changeset View
Standalone View
Standalone View
src/TerminalDisplay.h
Show All 15 Lines | 1 | /* | |||
---|---|---|---|---|---|
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
18 | 02110-1301 USA. | 18 | 02110-1301 USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef TERMINALDISPLAY_H | 21 | #ifndef TERMINALDISPLAY_H | ||
22 | #define TERMINALDISPLAY_H | 22 | #define TERMINALDISPLAY_H | ||
23 | 23 | | |||
24 | #include <functional> | ||||
25 | | ||||
24 | // Qt | 26 | // Qt | ||
25 | #include <QColor> | 27 | #include <QColor> | ||
26 | #include <QPointer> | 28 | #include <QPointer> | ||
27 | #include <QWidget> | 29 | #include <QWidget> | ||
28 | 30 | | |||
29 | // Konsole | 31 | // Konsole | ||
30 | #include "Character.h" | 32 | #include "Character.h" | ||
31 | #include "konsoleprivate_export.h" | 33 | #include "konsoleprivate_export.h" | ||
32 | #include "ScreenWindow.h" | 34 | #include "ScreenWindow.h" | ||
33 | #include "ColorScheme.h" | 35 | #include "ColorScheme.h" | ||
34 | #include "Enumeration.h" | 36 | #include "Enumeration.h" | ||
35 | #include "ScrollState.h" | 37 | #include "ScrollState.h" | ||
36 | 38 | | |||
37 | class QDrag; | 39 | class QDrag; | ||
38 | class QDragEnterEvent; | 40 | class QDragEnterEvent; | ||
39 | class QDropEvent; | 41 | class QDropEvent; | ||
40 | class QLabel; | 42 | class QLabel; | ||
41 | class QTimer; | 43 | class QTimer; | ||
42 | class QEvent; | 44 | class QEvent; | ||
43 | class QGridLayout; | 45 | class QVBoxLayout; | ||
44 | class QKeyEvent; | 46 | class QKeyEvent; | ||
45 | class QScrollBar; | 47 | class QScrollBar; | ||
46 | class QShowEvent; | 48 | class QShowEvent; | ||
47 | class QHideEvent; | 49 | class QHideEvent; | ||
48 | class QTimerEvent; | 50 | class QTimerEvent; | ||
49 | 51 | | |||
52 | class KMessageWidget; | ||||
53 | | ||||
50 | namespace Konsole { | 54 | namespace Konsole { | ||
51 | class FilterChain; | 55 | class FilterChain; | ||
52 | class TerminalImageFilterChain; | 56 | class TerminalImageFilterChain; | ||
53 | class SessionController; | 57 | class SessionController; | ||
54 | /** | 58 | /** | ||
55 | * A widget which displays output from a terminal emulation and sends input keypresses and mouse activity | 59 | * A widget which displays output from a terminal emulation and sends input keypresses and mouse activity | ||
56 | * to the terminal. | 60 | * to the terminal. | ||
57 | * | 61 | * | ||
▲ Show 20 Lines • Show All 588 Lines • ▼ Show 20 Line(s) | 555 | public Q_SLOTS: | |||
646 | */ | 650 | */ | ||
647 | void setMargin(int margin); | 651 | void setMargin(int margin); | ||
648 | 652 | | |||
649 | /** | 653 | /** | ||
650 | * Sets whether the contents are centered between the margins. | 654 | * Sets whether the contents are centered between the margins. | ||
651 | */ | 655 | */ | ||
652 | void setCenterContents(bool enable); | 656 | void setCenterContents(bool enable); | ||
653 | 657 | | |||
658 | // Used to show/hide the message widget | ||||
659 | void updateReadOnlyState(bool readonly); | ||||
660 | | ||||
654 | Q_SIGNALS: | 661 | Q_SIGNALS: | ||
655 | 662 | | |||
656 | /** | 663 | /** | ||
657 | * Emitted when the user presses a key whilst the terminal widget has focus. | 664 | * Emitted when the user presses a key whilst the terminal widget has focus. | ||
658 | */ | 665 | */ | ||
659 | void keyPressedSignal(QKeyEvent *event); | 666 | void keyPressedSignal(QKeyEvent *event); | ||
660 | 667 | | |||
661 | /** | 668 | /** | ||
▲ Show 20 Lines • Show All 196 Lines • ▼ Show 20 Line(s) | 780 | private: | |||
858 | QPoint findLineStart(const QPoint &pnt); | 865 | QPoint findLineStart(const QPoint &pnt); | ||
859 | QPoint findLineEnd(const QPoint &pnt); | 866 | QPoint findLineEnd(const QPoint &pnt); | ||
860 | QPoint findWordStart(const QPoint &pnt); | 867 | QPoint findWordStart(const QPoint &pnt); | ||
861 | QPoint findWordEnd(const QPoint &pnt); | 868 | QPoint findWordEnd(const QPoint &pnt); | ||
862 | 869 | | |||
863 | // Uses the current settings for trimming whitespace and preserving linebreaks to create a proper flag value for Screen | 870 | // Uses the current settings for trimming whitespace and preserving linebreaks to create a proper flag value for Screen | ||
864 | Screen::DecodingOptions currentDecodingOptions(); | 871 | Screen::DecodingOptions currentDecodingOptions(); | ||
865 | 872 | | |||
873 | // Boilerplate setup for MessageWidget | ||||
874 | KMessageWidget* createMessageWidget(const QString &text, std::function<void (const QString&)> linkHandler); | ||||
875 | | ||||
866 | // the window onto the terminal screen which this display | 876 | // the window onto the terminal screen which this display | ||
867 | // is currently showing. | 877 | // is currently showing. | ||
868 | QPointer<ScreenWindow> _screenWindow; | 878 | QPointer<ScreenWindow> _screenWindow; | ||
869 | 879 | | |||
870 | bool _bellMasked; | 880 | bool _bellMasked; | ||
871 | 881 | | |||
872 | QGridLayout *_gridLayout; | 882 | QVBoxLayout *_verticalLayout; | ||
873 | 883 | | |||
874 | bool _fixedFont; // has fixed pitch | 884 | bool _fixedFont; // has fixed pitch | ||
875 | int _fontHeight; // height | 885 | int _fontHeight; // height | ||
876 | int _fontWidth; // width | 886 | int _fontWidth; // width | ||
877 | int _fontAscent; // ascend | 887 | int _fontAscent; // ascend | ||
878 | bool _boldIntense; // Whether intense colors should be rendered with bold font | 888 | bool _boldIntense; // Whether intense colors should be rendered with bold font | ||
879 | 889 | | |||
880 | int _leftMargin; // offset | 890 | int _leftMargin; // offset | ||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | |||||
947 | 957 | | |||
948 | QLabel *_resizeWidget; | 958 | QLabel *_resizeWidget; | ||
949 | QTimer *_resizeTimer; | 959 | QTimer *_resizeTimer; | ||
950 | 960 | | |||
951 | bool _flowControlWarningEnabled; | 961 | bool _flowControlWarningEnabled; | ||
952 | 962 | | |||
953 | //widgets related to the warning message that appears when the user presses Ctrl+S to suspend | 963 | //widgets related to the warning message that appears when the user presses Ctrl+S to suspend | ||
954 | //terminal output - informing them what has happened and how to resume output | 964 | //terminal output - informing them what has happened and how to resume output | ||
955 | QLabel *_outputSuspendedLabel; | 965 | KMessageWidget *_outputSuspendedMessageWidget; | ||
956 | 966 | | |||
957 | uint _lineSpacing; | 967 | uint _lineSpacing; | ||
958 | 968 | | |||
959 | QSize _size; | 969 | QSize _size; | ||
960 | 970 | | |||
961 | QRgb _blendColor; | 971 | QRgb _blendColor; | ||
962 | 972 | | |||
963 | ColorSchemeWallpaper::Ptr _wallpaper; | 973 | ColorSchemeWallpaper::Ptr _wallpaper; | ||
Show All 31 Lines | |||||
995 | 1005 | | |||
996 | bool _trimLeadingSpaces; // trim leading spaces in selected text | 1006 | bool _trimLeadingSpaces; // trim leading spaces in selected text | ||
997 | bool _trimTrailingSpaces; // trim trailing spaces in selected text | 1007 | bool _trimTrailingSpaces; // trim trailing spaces in selected text | ||
998 | bool _mouseWheelZoom; // enable mouse wheel zooming or not | 1008 | bool _mouseWheelZoom; // enable mouse wheel zooming or not | ||
999 | 1009 | | |||
1000 | int _margin; // the contents margin | 1010 | int _margin; // the contents margin | ||
1001 | bool _centerContents; // center the contents between margins | 1011 | bool _centerContents; // center the contents between margins | ||
1002 | 1012 | | |||
1013 | KMessageWidget *_readOnlyMessageWidget; // Message shown at the top when read-only mode gets activated | ||||
1014 | | ||||
1003 | qreal _opacity; | 1015 | qreal _opacity; | ||
1004 | 1016 | | |||
1005 | ScrollState _scrollWheelState; | 1017 | ScrollState _scrollWheelState; | ||
1006 | 1018 | | |||
1007 | friend class TerminalDisplayAccessible; | 1019 | friend class TerminalDisplayAccessible; | ||
1008 | }; | 1020 | }; | ||
1009 | 1021 | | |||
1010 | class AutoScrollHandler : public QObject | 1022 | class AutoScrollHandler : public QObject | ||
Show All 19 Lines |