26 #if defined (HAVE_CONFIG_H)
36 #include <QApplication>
40 #include <QtCore/QEvent>
41 #include <QtCore/QTime>
42 #include <QtCore/QFile>
43 #include <QGridLayout>
62 #define loc(X,Y) ((Y)*_columns+(X))
65 #define yMouseScroll 1
67 #define REPCHAR "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
68 "abcdefgjijklmnopqrstuvwxyz" \
123 QPalette p = palette();
128 _scrollBar->setPalette( QApplication::palette() );
155 0x0020, 0x25C6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0,
156 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c,
157 0xF800, 0xF801, 0x2500, 0xF803, 0xF804, 0x251c, 0x2524, 0x2534,
158 0x252c, 0x2502, 0x2264, 0x2265, 0x03C0, 0x2260, 0x00A3, 0x00b7
163 QFontMetrics fm(font());
202 QFontMetrics metrics(font);
204 if ( metrics.height() < height() && metrics.maxWidth() < width() )
209 font.setStyleStrategy( QFont::NoAntialias );
216 int strategy = font.styleStrategy();
217 #if defined (HAVE_QFONT_FORCE_INTEGER_METRICS)
218 strategy |= QFont::ForceIntegerMetrics;
220 font.setStyleStrategy(QFont::StyleStrategy(strategy));
222 QWidget::setFont(font);
240 ,_screenWindow(nullptr)
242 ,_gridLayout(nullptr)
255 ,_terminalSizeHint(false)
256 ,_terminalSizeStartup(true)
257 ,_disabledBracketedPasteMode(false)
259 ,_wordSelectionMode(false)
260 ,_lineSelectionMode(false)
261 ,_preserveLineBreaks(false)
262 ,_columnSelectionMode(false)
263 ,_scrollbarLocation(NoScrollBar)
264 ,_wordCharacters(
":@-./_~")
265 ,_bellMode(SystemBeepBell)
267 ,_cursorBlinking(false)
268 ,_hasBlinkingCursor(false)
270 ,_tripleClickMode(SelectWholeLine)
272 ,_possibleTripleClick(false)
273 ,_resizeWidget(nullptr)
274 ,_resizeTimer(nullptr)
275 ,_outputSuspendedLabel(nullptr)
277 ,_colorsInverted(false)
278 ,_blendColor(qRgba(0,0,0,0xff))
280 ,_cursorShape(BlockCursor)
285 setLayoutDirection(Qt::LeftToRight);
298 connect(
_scrollBar, SIGNAL(valueChanged(
int)),
this,
318 setMouseTracking(
true);
321 setAcceptDrops(
true);
324 setFocusPolicy( Qt::WheelFocus );
327 setAttribute(Qt::WA_InputMethodEnabled,
true);
331 setAttribute(Qt::WA_OpaquePaintEvent);
341 qApp->removeEventFilter(
this );
414 if (useForegroundColor)
438 QRect scrollBarArea =
_scrollBar->isVisible() ?
442 QRegion contentsRegion = QRegion(rect).subtracted(scrollBarArea);
443 QRect contentsRect = contentsRegion.boundingRect();
445 painter.fillRect(contentsRect, backgroundColor);
446 painter.fillRect(scrollBarArea,
_scrollBar->palette().window());
451 const QColor& foregroundColor,
453 bool& invertCharacterColor)
455 QRect cursorRect = rect;
463 painter.setPen(foregroundColor);
470 int penWidth = qMax(1,painter.pen().width());
472 painter.drawRect(cursorRect.adjusted(penWidth/2,
474 - penWidth/2 - penWidth%2,
475 - penWidth/2 - penWidth%2));
484 invertCharacterColor =
true;
489 painter.drawLine(cursorRect.left(),
492 cursorRect.bottom());
494 painter.drawLine(cursorRect.left(),
497 cursorRect.bottom());
506 bool invertCharacterColor)
516 QFont font = painter.font();
517 if ( font.bold() != useBold
518 || font.underline() != useUnderline )
520 font.setBold(useBold);
521 font.setUnderline(useUnderline);
522 painter.setFont(font);
528 QPen pen = painter.pen();
529 if ( pen.color() != color )
532 painter.setPen(color);
540 painter.drawText(rect,0,text);
555 if ( backgroundColor != palette().window().color() )
560 bool invertCharacterColor =
false;
563 drawCursor(painter,rect,foregroundColor,backgroundColor,invertCharacterColor);
577 void TerminalDisplay::setCursorPos(
const int curx,
const int cury)
579 QPoint tL = contentsRect().topLeft();
584 ypos = _topMargin + tLy + _fontHeight*(cury-1) + _fontAscent;
585 xpos = _leftMargin + tLx + _fontWidth*curx;
619 QRect region = screenWindowRegion;
620 region.setBottom( qMin(region.bottom(),this->_lines-2) );
625 || (region.top() +
abs(
lines)) >= region.bottom()
626 || this->_lines <= region.height() )
635 int linesToMove = region.height() -
abs(
lines);
636 int bytesToMove = linesToMove *
640 Q_ASSERT( linesToMove > 0 );
641 Q_ASSERT( bytesToMove > 0 );
647 Q_ASSERT( (
char*)lastCharPos + bytesToMove <
653 memmove( firstCharPos , lastCharPos , bytesToMove );
664 Q_ASSERT( (
char*)firstCharPos + bytesToMove <
668 memmove( lastCharPos , firstCharPos , bytesToMove );
674 scrollRect = QRect( topPoint ,
692 rect.setBottom(hotSpot->
endLine());
719 update( preUpdateHotSpots | postUpdateHotSpots );
744 Q_ASSERT( this->_usedLines <= this->
_lines );
745 Q_ASSERT( this->_usedColumns <= this->
_columns );
749 QPoint tL = contentsRect().topLeft();
759 const int linesToUpdate = qMin(this->_lines, qMax(0,
lines ));
760 const int columnsToUpdate = qMin(this->_columns,qMax(0,
columns));
762 QChar *disstrU =
new QChar[columnsToUpdate];
763 char *dirtyMask =
new char[columnsToUpdate+2];
769 int dirtyLineCount = 0;
771 for (y = 0; y < linesToUpdate; y++)
776 bool updateLine =
false;
781 memset(dirtyMask, 0, columnsToUpdate+2);
783 for(
x = 0 ;
x < columnsToUpdate ;
x++)
785 if ( newLine[
x] != currentLine[
x] )
792 for (
x = 0;
x < columnsToUpdate;
x++)
806 bool doubleWidth = (
x+1 == columnsToUpdate) ?
false : (newLine[
x+1].character == 0);
810 int lln = columnsToUpdate -
x;
818 bool nextIsDoubleWidth = (
x+
len+1 == columnsToUpdate) ?
false : (newLine[
x+
len+1].character == 0);
824 nextIsDoubleWidth != doubleWidth )
830 QString unistr(disstrU, p);
864 dirtyRegion |= dirtyRect;
869 memcpy((
void*)currentLine,(
const void*)newLine,columnsToUpdate*
sizeof(
Character));
919 _resizeWidget->setStyleSheet(
"background-color:palette(window);border-style:solid;border-width:1px;border-color:palette(dark)");
926 QString sizeStr = QString(
"Size: %1 x %2").arg(
_columns).arg(
_lines);
962 #if defined (HAVE_QREGION_ITERATORS)
963 for (QRect rect : (pe->region() & contentsRect()))
965 foreach (QRect rect, (pe->region() & contentsRect()).rects())
985 QWidget::focusInEvent(focusEvent);
994 QWidget::focusOutEvent(focusEvent);
1009 if ( preeditLength == 0 )
1025 bool invertColors =
false;
1031 drawCursor(painter,rect,foreground,background,invertColors);
1048 QPoint cursorPos = mapFromGlobal(QCursor::pos());
1060 QListIterator<Filter::HotSpot*> iter(spots);
1061 while (iter.hasNext())
1065 for (
int line = spot->
startLine() ; line <= spot->endLine() ; line++ )
1067 int startColumn = 0;
1073 while ( QChar(
_image[
loc(endColumn,line)].character).isSpace() && endColumn > 0 )
1082 if ( line == spot->
endLine() )
1102 QFontMetrics metrics(font());
1106 int baseline =
r.bottom() + 1;
1108 int underlinePos = baseline + metrics.underlinePos();
1110 if (
r.contains (mapFromGlobal(QCursor::pos())))
1113 painter.setPen (QColor (255,0,0));
1114 painter.drawLine (
r.left(), underlinePos,
1115 r.right() + 2, underlinePos);
1123 painter.fillRect(
r,QBrush(QColor(255,0,0,120)));
1133 QPoint topLeft = contentsRect().topLeft();
1135 int topLeftY = topLeft.y();
1149 QChar *disstrU =
new QChar[bufferSize];
1150 for (
int y = leftUpperY; y <= rightLowerY; y++)
1156 for (;
x <= rightLowerX;
x++)
1165 ushort extendedCharLength = 0;
1168 for (
int index = 0 ; index < extendedCharLength ; index++ )
1170 Q_ASSERT( p < bufferSize );
1171 disstrU[p++] = chars[index];
1180 Q_ASSERT( p < bufferSize );
1190 while (
x+
len <= rightLowerX &&
1191 _image[
loc(
x+
len,y)].foregroundColor == currentForeground &&
1192 _image[
loc(
x+
len,y)].backgroundColor == currentBackground &&
1209 QString unistr(disstrU,p);
1234 QTransform inverted = paint.transform().inverted();
1235 textArea.moveCenter( inverted.map(textArea.center()) );
1248 paint.resetTransform();
1282 result.setWidth(
_fontWidth * imageArea.width() );
1283 result.setHeight(
_fontHeight * imageArea.height() );
1317 parentWidget()->adjustSize();
1318 parentWidget()->setFixedSize(parentWidget()->
sizeHint());
1342 for (
int line = 0; line <
lines; line++)
1360 #if defined (SIGWINCH)
1456 if ( !contentsRect().contains(ev->pos()) )
return;
1463 QPoint pos = QPoint(charColumn,charLine);
1465 if ( ev->button() == Qt::LeftButton)
1473 if (actions.length ())
1474 actions.at (0)->activate (QAction::Trigger);
1483 bool selected =
false;
1491 if ((!
_ctrlDrag || ev->modifiers() & Qt::ControlModifier) && selected ) {
1500 _preserveLineBreaks = !( ( ev->modifiers() & Qt::ControlModifier ) && !(ev->modifiers() & Qt::AltModifier) );
1501 _columnSelectionMode = (ev->modifiers() & Qt::AltModifier) && (ev->modifiers() & Qt::ControlModifier);
1503 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1519 else if ( ev->button() == Qt::MiddleButton )
1526 else if ( ev->button() == Qt::RightButton )
1528 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1531 ev->modifiers() & (Qt::ShiftModifier|Qt::ControlModifier),
1539 QWidget::mousePressEvent (ev);
1544 int charLine, charColumn;
1567 setCursor (Qt::PointingHandCursor);
1577 const QString& tooltip = spot->
tooltip();
1578 if ( !tooltip.isEmpty() )
1594 if (ev->buttons() == Qt::NoButton )
return;
1599 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1602 if (ev->buttons() & Qt::LeftButton)
1604 if (ev->buttons() & Qt::MiddleButton)
1606 if (ev->buttons() & Qt::RightButton)
1645 if (ev->buttons() & Qt::MiddleButton)
return;
1651 void TerminalDisplay::setSelectionEnd()
1653 extendSelection( _configureRequestPoint );
1658 QPoint pos = position;
1664 QPoint tL = contentsRect().topLeft();
1698 QPoint here = QPoint(charColumn, charLine);
1704 bool swapping =
false;
1711 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1712 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1713 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1714 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1715 swapping = left_not_right != old_left_not_right;
1718 QPoint
left = left_not_right ? here : _iPntSelCorr;
1735 QPoint right = left_not_right ? _iPntSelCorr : here;
1736 i =
loc(right.x(), right.y());
1752 if (left_not_right) {
1764 bool above_not_below = (here.y() < _iPntSelCorr.y());
1766 QPoint above = above_not_below ? here : _iPntSelCorr;
1767 QPoint below = above_not_below ? _iPntSelCorr : here;
1780 if (above_not_below) {
1788 QPoint newSelBegin = QPoint(ohere.x(), ohere.y());
1800 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1801 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1802 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1803 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1804 swapping = left_not_right != old_left_not_right;
1807 QPoint
left = left_not_right ? here : _iPntSelCorr;
1810 QPoint right = left_not_right ? _iPntSelCorr : here;
1812 i =
loc(right.x(), right.y());
1815 if (selClass ==
' ') {
1822 right = left_not_right ? _iPntSelCorr : here;
1831 if (left_not_right) {
1842 if ((here == _pntSelCorr) && (scroll ==
_scrollBar->value())) {
1846 if (here == ohere) {
1850 if (
_actSel < 2 || swapping) {
1852 _screenWindow->setSelectionStart(ohere.x(), ohere.y(),
true);
1854 _screenWindow->setSelectionStart(ohere.x() - 1 - offset , ohere.y(),
false);
1866 _screenWindow->setSelectionEnd(here.x() + offset, here.y());
1879 if ( ev->button() == Qt::LeftButton)
1901 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1911 ((ev->button() == Qt::RightButton && !(ev->modifiers() & Qt::ShiftModifier))
1912 || ev->button() == Qt::MiddleButton) )
1920 QWidget::mouseReleaseEvent(ev);
1956 if ( ev->button() != Qt::LeftButton)
return;
1964 QPoint pos(charColumn,charLine);
1967 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1979 QPoint bgnSel = pos;
1980 QPoint endSel = pos;
1981 int i =
loc(bgnSel.x(),bgnSel.y());
2006 _screenWindow->setSelectionStart( bgnSel.x() , bgnSel.y() ,
false );
2009 i =
loc( endSel.x(), endSel.y() );
2027 if ( ( QChar(
_image[i].character ) ==
'@' ) && ( ( endSel.x() - bgnSel.x() ) > 0 ) )
2028 endSel.setX(
x - 1 );
2040 QTimer::singleShot(QApplication::doubleClickInterval(),
this,
2046 #if defined (HAVE_QWHEELEVENT_ANGLEDELTA)
2047 if (ev->angleDelta().y() == 0)
2050 if (ev->orientation() != Qt::Vertical)
2060 #if defined (HAVE_QWHEELEVENT_POSITION)
2061 QPoint pos = ev->position().toPoint();
2063 QPoint pos = ev->pos();
2067 #if defined (HAVE_QWHEELEVENT_ANGLEDELTA)
2068 int delta = ev->angleDelta().y();
2070 int delta = ev->delta();
2091 _iPntSel = QPoint(charColumn,charLine);
2151 return QWidget::focusNextPrevChild(
next );
2157 QChar qch=QChar(ch);
2158 if ( qch.isSpace() )
return ' ';
2160 if ( qch.isLetterOrNumber() ||
_wordCharacters.contains(qch, Qt::CaseInsensitive ) )
2175 setCursor(
_mouseMarks ? Qt::IBeamCursor : Qt::ArrowCursor );
2206 QString text = QApplication::clipboard()->text(useXselection ? QClipboard::Selection :
2207 QClipboard::Clipboard);
2210 if ( ! text.isEmpty() )
2212 text.replace(
"\n",
"\r");
2215 else if (text.contains (
"\t"))
2217 qWarning (
"converting TAB to SPC in pasted text before processing");
2218 text.replace (
"\t",
" ");
2220 QKeyEvent e(QEvent::KeyPress, 0, Qt::NoModifier, text);
2229 text.prepend(
"\033[200~");
2230 text.append(
"\033[201~");
2235 QApplication::clipboard()->setText(t, QClipboard::Selection);
2245 if (text.isEmpty ())
2247 if (! extra_interrupt)
2251 QApplication::clipboard()->setText(text);
2292 bool emitKeyPressSignal =
true;
2295 if ( event->modifiers() == Qt::ShiftModifier )
2299 if ( event->key() == Qt::Key_PageUp )
2304 else if ( event->key() == Qt::Key_PageDown )
2309 else if ( event->key() == Qt::Key_Up )
2314 else if ( event->key() == Qt::Key_Down )
2332 emitKeyPressSignal =
false;
2363 QKeyEvent keyEvent(QEvent::KeyPress,0,Qt::NoModifier,event->commitString());
2376 #if defined (HAVE_QT_IMCURSORRECTANGLE_ENUM_VALUE)
2377 case Qt::ImCursorRectangle:
2379 case Qt::ImMicroFocus:
2381 return imageToWidget(QRect(cursorPos.x(),cursorPos.y(),1,1));
2386 case Qt::ImCursorPosition:
2388 return cursorPos.x();
2390 case Qt::ImSurroundingText:
2394 QTextStream
stream(&lineText);
2402 case Qt::ImCurrentSelection:
2447 _scrollBar->resize(QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent),
2448 contentsRect().height());
2512 if ( newSize != size() )
2535 QWidget::setFixedSize(
_size);
2552 if (event->mimeData()->hasFormat(
"text/plain"))
2553 event->acceptProposedAction();
2562 if (event->mimeData ()->hasUrls ())
2564 foreach (QUrl url, event->mimeData ()->urls ())
2566 if(dropText.length () > 0)
2568 dropText += url.toLocalFile ();
2599 if(event->mimeData()->hasFormat(
"text/plain"))
2609 QMimeData *mimeData =
new QMimeData;
2610 mimeData->setText(QApplication::clipboard()->text(QClipboard::Selection));
2627 "<a href=\"http://en.wikipedia.org/wiki/XON\">suspended</a>"
2628 " by pressing Ctrl+S."
2629 " Press <b>Ctrl+Q</b> to resume.</qt>"),
2634 palette.setColor(QPalette::Normal, QPalette::WindowText, QColor(Qt::white));
2635 palette.setColor(QPalette::Normal, QPalette::Window, QColor(Qt::black));
2646 Qt::LinksAccessibleByKeyboard);
2651 _gridLayout->addItem(
new QSpacerItem(0,0,QSizePolicy::Expanding,
2652 QSizePolicy::Expanding),
#define COLOR_SPACE_DEFAULT
#define DEFAULT_FORE_COLOR
#define DEFAULT_BACK_COLOR
static const ColorEntry base_color_table[(2 *(2+8))]
static const int LINE_DOUBLEHEIGHT
static const int LINE_WRAPPED
#define DEFAULT_RENDITION
static const int LINE_DOUBLEWIDTH
LineEncode
A table for emulating the simple (single width) unicode drawing chars.
unsigned short vt100_graphics[32]
Describes the color of a single character in the terminal.
QColor color(const ColorEntry *palette) const
Returns the color within the specified color @palette.
A single character in the terminal which consists of a unicode character value, foreground and backgr...
CharacterColor backgroundColor
The color used to draw this character's background.
CharacterColor foregroundColor
The foreground color used to draw this character.
quint16 character
The unicode character value for this character.
quint8 rendition
A combination of RENDITION flags which specify options for drawing the character.
bool isBold(const ColorEntry *base) const
Returns true if this character should always be drawn in bold when it is drawn with the specified pal...
An entry in a terminal display's color palette.
QColor color
The color value of this entry for display.
ushort * lookupExtendedChar(ushort hash, ushort &length) const
Looks up and returns a pointer to a sequence of unicode characters which was added to the table using...
static ExtendedCharTable instance
The global ExtendedCharTable instance.
A chain which allows a group of filters to be processed as one.
void process()
Processes each filter in the chain.
Filter::HotSpot * hotSpotAt(int line, int column) const
Returns the first hotspot which occurs at line, column or 0 if no hotspot was found.
QList< Filter::HotSpot * > hotSpots() const
Returns a list of all the hotspots in all the chain's filters.
virtual QString tooltip() const
Returns the text of a tooltip to be shown when the mouse moves over the hotspot, or an empty string i...
int endLine() const
Returns the line where the hotspot area ends.
int startLine() const
Returns the line when the hotspot area starts.
int endColumn() const
Returns the column on endLine() where the hotspot area ends.
virtual QList< QAction * > actions()
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar.
Type type() const
Returns the type of the hotspot.
int startColumn() const
Returns the column on startLine() where the hotspot area starts.
A terminal character decoder which produces plain text, ignoring colours and other appearance-related...
virtual void decodeLine(const Character *const characters, int count, LineProperty properties)
Converts a line of terminal characters with associated properties into a text string and writes the s...
virtual void begin(QTextStream *output)
Begin decoding characters.
virtual void end()
End decoding.
Provides a window onto a section of a terminal screen.
void setWindowLines(int lines)
Sets the number of lines in the window.
A filter chain which processes character images from terminal displays.
void setImage(const Character *const image, int lines, int columns, const QVector< LineProperty > &lineProperties)
Set the current terminal image to image.
void selectAll()
selects all content
virtual void showEvent(QShowEvent *)
FilterChain * filterChain() const
Returns the display's filter chain.
QGridLayout * _gridLayout
uint randomSeed() const
Returns the seed used to generate random colors for the display (in color schemes that support them).
QRect preeditRect() const
virtual void inputMethodEvent(QInputMethodEvent *event)
bool _columnSelectionMode
void setWordCharacters(const QString &wc)
Sets which characters, in addition to letters and numbers, are regarded as being part of a word for t...
void processFilters()
Updates the filters in the display's filter chain.
static const int BLINK_DELAY
void updateLineProperties()
Causes the terminal display to fetch the latest line status flags from the associated terminal screen...
virtual void extendSelection(const QPoint &pos)
void pasteClipboard()
Pastes the content of the clipboard into the display.
static const int DEFAULT_TOP_MARGIN
void sendStringToEmu(const char *)
virtual void resizeEvent(QResizeEvent *)
QVector< LineProperty > _lineProperties
void drawInputMethodPreeditString(QPainter &painter, const QRect &rect)
void drawBackground(QPainter &painter, const QRect &rect, const QColor &color)
virtual void setFont(const QFont &)
Reimplemented.
void drawCursor(QPainter &painter, const QRect &rect, const QColor &foregroundColor, const QColor &backgroundColor, bool &invertColors)
void drawTextFragment(QPainter &painter, const QRect &rect, const QString &text, const Character *style)
void getCharacterPosition(const QPoint &widgetPoint, int &line, int &column) const
virtual void hideEvent(QHideEvent *)
QTimer * _blinkCursorTimer
void setBellMode(int mode)
Sets the type of effect used to alert the user when a 'bell' occurs in the terminal session.
void setUsesMouse(bool usesMouse)
Sets whether the program whoose output is being displayed in the view is interested in mouse events.
void changedFontMetricSignal(int height, int width)
virtual void mouseReleaseEvent(QMouseEvent *)
void scrollBarPositionChanged(int value)
static const int DEFAULT_LEFT_MARGIN
void setScroll(int cursor, int lines)
Sets the current position and range of the display's scroll bar.
void configureRequest(TerminalView *, int state, const QPoint &position)
Emitted when the user right clicks on the display, or right-clicks with the Shift key held down if us...
void setRandomSeed(uint seed)
Sets the seed used to generate random colors for the display (in color schemes that support them).
void isBusySelecting(bool)
void copyClipboard(bool extra_interrupt)
Copies the selected text to the clipboard.
void interrupt_signal(void)
QPoint cursorPosition() const
@ SelectForwardsFromCursor
Select from the current cursor position to the end of the line.
@ SelectWholeLine
Select the whole line underneath the cursor.
void setColorTable(const ColorEntry table[])
Sets the terminal color palette used by the display.
void setScrollBarPosition(ScrollBarPosition position)
Specifies whether the terminal display has a vertical scroll bar, and if so whether it is shown on th...
ScreenWindow * screenWindow() const
Returns the terminal screen section which is displayed in this widget.
void setKeyboardCursorShape(KeyboardCursorShape shape)
Sets the shape of the keyboard cursor.
void focusInEvent(QFocusEvent *focusEvent)
QPointer< ScreenWindow > _screenWindow
TerminalImageFilterChain * _filterChain
virtual bool focusNextPrevChild(bool next)
void setScreenWindow(ScreenWindow *window)
Sets the terminal screen section which is displayed in this widget.
virtual int charClass(quint16) const
void setKeyboardCursorColor(bool useForegroundColor, const QColor &color)
Sets the color used to draw the keyboard cursor.
ColorEntry _colorTable[TABLE_COLORS]
TripleClickMode _tripleClickMode
bool _terminalSizeStartup
void bracketText(QString &text)
change and wrap text corresponding to paste mode
void setVTFont(const QFont &font)
Sets the font used to draw the display.
QRect _mouseOverHotspotArea
void updateImage()
Causes the terminal display to fetch the latest character image from the associated terminal screen (...
int columns()
Returns the number of characters of text which can be displayed on each line in the widget.
virtual void mouseMoveEvent(QMouseEvent *)
InputMethodData _inputMethodData
void focusOutEvent(QFocusEvent *focusEvent)
void mouseSignal(int button, int column, int line, int eventType)
A mouse event occurred.
void setSelection(const QString &t)
void setBlinkingCursor(bool blink)
Specifies whether or not the cursor blinks.
void drawCharacters(QPainter &painter, const QRect &rect, const QString &text, const Character *style, bool invertCharacterColor)
bool usesMouse() const
See setUsesMouse()
virtual void mousePressEvent(QMouseEvent *)
KeyboardCursorShape _cursorShape
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
virtual void mouseDoubleClickEvent(QMouseEvent *ev)
void paintFilters(QPainter &painter)
QList< QAction * > filterActions(const QPoint &position)
Returns a list of menu actions created by the filters for the content at the given position.
virtual void keyPressEvent(QKeyEvent *event)
ScrollBarPosition
This enum describes the location where the scroll bar is positioned in the display widget.
@ ScrollBarLeft
Show the scroll bar on the left side of the display.
@ NoScrollBar
Do not show the scroll bar.
@ ScrollBarRight
Show the scroll bar on the right side of the display.
virtual void dropEvent(QDropEvent *event)
QRect imageToWidget(const QRect &imageArea) const
virtual void dragEnterEvent(QDragEnterEvent *event)
void setFixedSize(int cols, int lins)
void setBlinkingCursorState(bool blink)
int lines()
Returns the number of lines of text which can be displayed in the widget.
virtual void fontChange(const QFont &font)
void tripleClickTimeout()
virtual void wheelEvent(QWheelEvent *)
QLabel * _outputSuspendedLabel
struct TerminalView::_dragInfo dragInfo
KeyboardCursorShape
This enum describes the available shapes for the keyboard cursor.
@ UnderlineCursor
A single flat line which occupies the space at the bottom of the cursor character's area.
@ IBeamCursor
An cursor shaped like the capital letter 'I', similar to the IBeam cursor used in Qt/KDE text editors...
@ BlockCursor
A rectangular block which covers the entire area of the cursor character.
QColor keyboardCursorColor() const
Returns the color of the keyboard cursor, or an invalid color if the keyboard cursor color is set to ...
KeyboardCursorShape keyboardCursorShape() const
Returns the shape of the keyboard cursor.
void setLineSpacing(uint)
void outputSuspended(bool suspended)
Causes the widget to display or hide a message informing the user that terminal output has been suspe...
bool _disabledBracketedPasteMode
const ColorEntry * colorTable() const
Returns the terminal color palette used by the display.
virtual void paintEvent(QPaintEvent *)
bool bracketedPasteMode() const
void pasteSelection()
Pastes the content of the selection into the display.
void visibility_changed(bool visible)
Is called, when the terminal's visibility has changed in order to stop orstart timers etc.
void tripleClicked(const QString &text)
void setSize(int cols, int lins)
void showResizeNotification()
QRegion hotSpotRegion() const
ScrollBarPosition _scrollbarLocation
TerminalView(QWidget *parent=nullptr)
Constructs a new terminal display widget with the specified parent.
void keyPressedSignal(QKeyEvent *e)
Emitted when the user presses a key whilst the terminal widget has focus.
void setBracketedPasteMode(bool bracketedPasteMode)
void changedContentSizeSignal(int height, int width)
void mouseTripleClickEvent(QMouseEvent *ev)
static bool _antialiasText
void emitSelection(bool useXselection, bool appendReturn)
void drawContents(QPainter &paint, const QRect &rect)
bool _possibleTripleClick
QTimer * _process_filter_timer
void scrollImage(int lines, const QRect ®ion)
int string_width(const QString &txt)
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f
T::size_type strlen(const typename T::value_type *str)
int qt_fontmetrics_horizontal_advance(const QFontMetrics &fm, QChar ch)