TerminalDisplay TerminalDisplay QWidget parent QWidget parent _screenW

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
TerminalDisplay::TerminalDisplay(QWidget* parent)
: QWidget(parent)
, _screenWindow(nullptr)
, _bellMasked(false)
, _verticalLayout(new QVBoxLayout(this))
, _fixedFont(true)
, _fontHeight(1)
, _fontWidth(1)
, _fontAscent(1)
, _boldIntense(true)
, _lines(1)
, _columns(1)
, _usedLines(1)
, _usedColumns(1)
, _contentRect(QRect())
, _image(nullptr)
, _imageSize(0)
, _lineProperties(QVector<LineProperty>())
, _randomSeed(0)
, _resizing(false)
, _showTerminalSizeHint(true)
, _bidiEnabled(false)
, _usesMouseTracking(false)
, _alternateScrolling(true)
, _bracketedPasteMode(false)
, _iPntSel(QPoint())
, _pntSel(QPoint())
, _tripleSelBegin(QPoint())
, _actSel(0)
, _wordSelectionMode(false)
, _lineSelectionMode(false)
, _preserveLineBreaks(true)
, _columnSelectionMode(false)
, _autoCopySelectedText(false)
, _copyTextAsHTML(true)
, _middleClickPasteMode(Enum::PasteFromX11Selection)
, _scrollBar(nullptr)
, _scrollbarLocation(Enum::ScrollBarRight)
, _scrollFullPage(false)
, _wordCharacters(QStringLiteral(":@-./_~"))
, _bellMode(Enum::NotifyBell)
, _allowBlinkingText(true)
, _allowBlinkingCursor(false)
, _textBlinking(false)
, _cursorBlinking(false)
, _hasTextBlinker(false)
, _urlHintsModifiers(Qt::NoModifier)
, _showUrlHint(false)
, _reverseUrlHints(false)
, _openLinksByDirectClick(false)
, _ctrlRequiredForDrag(true)
, _dropUrlsAsText(false)
, _tripleClickMode(Enum::SelectWholeLine)
, _possibleTripleClick(false)
, _resizeWidget(nullptr)
, _resizeTimer(nullptr)
, _flowControlWarningEnabled(false)
, _outputSuspendedMessageWidget(nullptr)
, _lineSpacing(0)
, _size(QSize())
, _blendColor(qRgba(0, 0, 0, 0xff))
, _wallpaper(nullptr)
, _filterChain(new TerminalImageFilterChain())
, _mouseOverHotspotArea(QRegion())
, _filterUpdateRequired(true)
, _cursorShape(Enum::BlockCursor)
, _cursorColor(QColor())
, _antialiasText(true)
, _useFontLineCharacters(false)
, _printerFriendly(false)
, _sessionController(nullptr)
, _trimLeadingSpaces(false)
, _trimTrailingSpaces(false)
, _mouseWheelZoom(false)
, _margin(1)
, _centerContents(false)
, _readOnlyMessageWidget(nullptr)
, _readOnly(false)
, _opacity(1.0)
, _dimWhenInactive(false)
, _scrollWheelState(ScrollState())
, _searchBar(new IncrementalSearchBar(this))
, _headerBar(new TerminalHeaderBar(this))
, _searchResultRect(QRect())
, _drawOverlay(false)
{
setLayoutDirection(Qt::LeftToRight);
_contentRect = QRect(_margin, _margin, 1, 1);
_scrollBar = new QScrollBar(this);
_scrollBar->setAutoFillBackground(false);
setScroll(0, 0);
_scrollBar->setCursor(Qt::ArrowCursor);
_headerBar->setCursor(Qt::ArrowCursor);
connect(_headerBar, &TerminalHeaderBar::requestToggleExpansion, this, &Konsole::TerminalDisplay::requestToggleExpansion);
connect(_scrollBar, &QScrollBar::valueChanged, this, &Konsole::TerminalDisplay::scrollBarPositionChanged);
connect(_scrollBar, &QScrollBar::sliderMoved, this, &Konsole::TerminalDisplay::viewScrolledByUser);
_blinkTextTimer = new QTimer(this);
_blinkTextTimer->setInterval(TEXT_BLINK_DELAY);
connect(_blinkTextTimer, &QTimer::timeout, this, &Konsole::TerminalDisplay::blinkTextEvent);
_blinkCursorTimer = new QTimer(this);
_blinkCursorTimer->setInterval(QApplication::cursorFlashTime() / 2);
connect(_blinkCursorTimer, &QTimer::timeout, this, &Konsole::TerminalDisplay::blinkCursorEvent);
KCursor::setAutoHideCursor(this, true);
setMouseTracking(true);
setUsesMouseTracking(false);
setBracketedPasteMode(false);
setColorTable(ColorScheme::defaultTable);
setAcceptDrops(true);
_dragInfo.state = diNone;
setFocusPolicy(Qt::WheelFocus);
setAttribute(Qt::WA_InputMethodEnabled, true);
// this is an important optimization, it tells Qt
// that TerminalDisplay will handle repainting its entire area.
setAttribute(Qt::WA_OpaquePaintEvent);
_verticalLayout->addWidget(_headerBar);
_verticalLayout->addStretch();
_verticalLayout->setSpacing(0);
_verticalLayout->setContentsMargins(0, 0, 0, 0);
setLayout(_verticalLayout);
new AutoScrollHandler(this);
}
TerminalDisplay::~TerminalDisplay()
{
disconnect(_blinkTextTimer);
disconnect(_blinkCursorTimer);
delete _readOnlyMessageWidget;
delete _outputSuspendedMessageWidget;
delete[] _image;
delete _filterChain;
_readOnlyMessageWidget = nullptr;
_outputSuspendedMessageWidget = nullptr;
}