Changeset View
Changeset View
Standalone View
Standalone View
src/TerminalDisplay.h
Show All 27 Lines | |||||
28 | 28 | | |||
29 | // Konsole | 29 | // Konsole | ||
30 | #include "Character.h" | 30 | #include "Character.h" | ||
31 | #include "konsoleprivate_export.h" | 31 | #include "konsoleprivate_export.h" | ||
32 | #include "ScreenWindow.h" | 32 | #include "ScreenWindow.h" | ||
33 | #include "ColorScheme.h" | 33 | #include "ColorScheme.h" | ||
34 | #include "Enumeration.h" | 34 | #include "Enumeration.h" | ||
35 | #include "ScrollState.h" | 35 | #include "ScrollState.h" | ||
36 | #include "TerminalScrollBar.h" | ||||
36 | 37 | | |||
37 | class QDrag; | 38 | class QDrag; | ||
38 | class QDragEnterEvent; | 39 | class QDragEnterEvent; | ||
39 | class QDropEvent; | 40 | class QDropEvent; | ||
40 | class QLabel; | 41 | class QLabel; | ||
41 | class QTimer; | 42 | class QTimer; | ||
42 | class QEvent; | 43 | class QEvent; | ||
43 | class QVBoxLayout; | 44 | class QVBoxLayout; | ||
44 | class QKeyEvent; | 45 | class QKeyEvent; | ||
45 | class QScrollBar; | 46 | class QScrollBar; | ||
46 | class QShowEvent; | 47 | class QShowEvent; | ||
47 | class QHideEvent; | 48 | class QHideEvent; | ||
48 | class QTimerEvent; | 49 | class QTimerEvent; | ||
49 | 50 | | |||
50 | class KMessageWidget; | 51 | class KMessageWidget; | ||
51 | 52 | | |||
52 | namespace Konsole { | 53 | namespace Konsole { | ||
53 | class FilterChain; | 54 | class FilterChain; | ||
54 | class TerminalImageFilterChain; | 55 | class TerminalImageFilterChain; | ||
55 | class SessionController; | 56 | class SessionController; | ||
57 | class TerminalScrollBar; | ||||
58 | | ||||
56 | /** | 59 | /** | ||
57 | * A widget which displays output from a terminal emulation and sends input keypresses and mouse activity | 60 | * A widget which displays output from a terminal emulation and sends input keypresses and mouse activity | ||
58 | * to the terminal. | 61 | * to the terminal. | ||
59 | * | 62 | * | ||
60 | * When the terminal emulation receives new output from the program running in the terminal, | 63 | * When the terminal emulation receives new output from the program running in the terminal, | ||
61 | * it will update the display by calling updateImage(). | 64 | * it will update the display by calling updateImage(). | ||
62 | * | 65 | * | ||
63 | * TODO More documentation | 66 | * TODO More documentation | ||
Show All 23 Lines | 72 | public: | |||
87 | uint randomSeed() const; | 90 | uint randomSeed() const; | ||
88 | 91 | | |||
89 | /** Sets the opacity of the terminal display. */ | 92 | /** Sets the opacity of the terminal display. */ | ||
90 | void setOpacity(qreal opacity); | 93 | void setOpacity(qreal opacity); | ||
91 | 94 | | |||
92 | /** Sets the background picture */ | 95 | /** Sets the background picture */ | ||
93 | void setWallpaper(ColorSchemeWallpaper::Ptr p); | 96 | void setWallpaper(ColorSchemeWallpaper::Ptr p); | ||
94 | 97 | | |||
95 | /** | 98 | TerminalScrollBar *scrollBar() const; | ||
96 | * Specifies whether the terminal display has a vertical scroll bar, and if so whether it | | |||
97 | * is shown on the left or right side of the display. | | |||
98 | */ | | |||
99 | void setScrollBarPosition(Enum::ScrollBarPositionEnum position); | | |||
100 | Enum::ScrollBarPositionEnum scrollBarPosition() const | | |||
101 | { | | |||
102 | return _scrollbarLocation; | | |||
103 | } | | |||
104 | 99 | | |||
105 | /** | 100 | /** connected to the valueChange on the scrollBar */ | ||
106 | * Sets the current position and range of the display's scroll bar. | 101 | void scrollBarValueChanged(int value); | ||
107 | * | 102 | | ||
108 | * @param cursor The position of the scroll bar's thumb. | 103 | /** connected to the positionChanged on the scrollBar */ | ||
109 | * @param slines The maximum value of the scroll bar. | 104 | void scrollBarPositionChanged(TerminalScrollBar::Position position); | ||
110 | */ | | |||
111 | void setScroll(int cursor, int slines); | | |||
112 | 105 | | |||
113 | void setScrollFullPage(bool fullPage); | 106 | void setScrollFullPage(bool fullPage); | ||
114 | bool scrollFullPage() const; | 107 | bool scrollFullPage() const; | ||
108 | void updateScrollBarPalette(); | ||||
115 | 109 | | |||
116 | /** | 110 | /** | ||
117 | * Returns the display's filter chain. When the image for the display is updated, | 111 | * Returns the display's filter chain. When the image for the display is updated, | ||
118 | * the text is passed through each filter in the chain. Each filter can define | 112 | * the text is passed through each filter in the chain. Each filter can define | ||
119 | * hotspots which correspond to certain strings (such as URLs or particular words). | 113 | * hotspots which correspond to certain strings (such as URLs or particular words). | ||
120 | * Depending on the type of the hotspots created by the filter ( returned by Filter::Hotspot::type() ) | 114 | * Depending on the type of the hotspots created by the filter ( returned by Filter::Hotspot::type() ) | ||
121 | * the view will draw visual cues such as underlines on mouse-over for links or translucent | 115 | * the view will draw visual cues such as underlines on mouse-over for links or translucent | ||
122 | * rectangles for markers. | 116 | * rectangles for markers. | ||
▲ Show 20 Lines • Show All 657 Lines • ▼ Show 20 Line(s) | 725 | protected: | |||
780 | 774 | | |||
781 | void mouseTripleClickEvent(QMouseEvent *ev); | 775 | void mouseTripleClickEvent(QMouseEvent *ev); | ||
782 | void selectLine(QPoint pos, bool entireLine); | 776 | void selectLine(QPoint pos, bool entireLine); | ||
783 | 777 | | |||
784 | // reimplemented | 778 | // reimplemented | ||
785 | void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE; | 779 | void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE; | ||
786 | QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; | 780 | QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; | ||
787 | 781 | | |||
788 | void updateScrollBarPalette(); | | |||
789 | 782 | | |||
790 | protected Q_SLOTS: | 783 | protected Q_SLOTS: | ||
791 | 784 | | |||
792 | void scrollBarPositionChanged(int value); | | |||
793 | void blinkTextEvent(); | 785 | void blinkTextEvent(); | ||
794 | void blinkCursorEvent(); | 786 | void blinkCursorEvent(); | ||
795 | 787 | | |||
796 | private Q_SLOTS: | 788 | private Q_SLOTS: | ||
797 | 789 | | |||
798 | void swapFGBGColors(); | 790 | void swapFGBGColors(); | ||
799 | void viewScrolledByUser(); | 791 | void viewScrolledByUser(); | ||
800 | 792 | | |||
▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Line(s) | 802 | private: | |||
959 | bool _lineSelectionMode; | 951 | bool _lineSelectionMode; | ||
960 | bool _preserveLineBreaks; | 952 | bool _preserveLineBreaks; | ||
961 | bool _columnSelectionMode; | 953 | bool _columnSelectionMode; | ||
962 | 954 | | |||
963 | bool _autoCopySelectedText; | 955 | bool _autoCopySelectedText; | ||
964 | bool _copyTextAsHTML; | 956 | bool _copyTextAsHTML; | ||
965 | Enum::MiddleClickPasteModeEnum _middleClickPasteMode; | 957 | Enum::MiddleClickPasteModeEnum _middleClickPasteMode; | ||
966 | 958 | | |||
967 | QScrollBar *_scrollBar; | 959 | TerminalScrollBar *_scrollBar; | ||
968 | Enum::ScrollBarPositionEnum _scrollbarLocation; | | |||
969 | bool _scrollFullPage; | 960 | bool _scrollFullPage; | ||
970 | QString _wordCharacters; | 961 | QString _wordCharacters; | ||
971 | int _bellMode; | 962 | int _bellMode; | ||
972 | 963 | | |||
973 | bool _allowBlinkingText; // allow text to blink | 964 | bool _allowBlinkingText; // allow text to blink | ||
974 | bool _allowBlinkingCursor; // allow cursor to blink | 965 | bool _allowBlinkingCursor; // allow cursor to blink | ||
975 | bool _textBlinking; // text is blinking, hide it when drawing | 966 | bool _textBlinking; // text is blinking, hide it when drawing | ||
976 | bool _cursorBlinking; // cursor is blinking, hide it when drawing | 967 | bool _cursorBlinking; // cursor is blinking, hide it when drawing | ||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | |||||
1068 | private: | 1059 | private: | ||
1069 | QWidget *widget() const | 1060 | QWidget *widget() const | ||
1070 | { | 1061 | { | ||
1071 | return static_cast<QWidget *>(parent()); | 1062 | return static_cast<QWidget *>(parent()); | ||
1072 | } | 1063 | } | ||
1073 | 1064 | | |||
1074 | int _timerId; | 1065 | int _timerId; | ||
1075 | }; | 1066 | }; | ||
1076 | } | | |||
1077 | 1067 | | |||
1068 | } | ||||
1078 | #endif // TERMINALDISPLAY_H | 1069 | #endif // TERMINALDISPLAY_H |