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);
339 parent->parent (), SLOT (set_global_shortcuts (
bool)));
341 parent, SLOT (set_global_shortcuts (
bool)));
347 qApp->removeEventFilter(
this );
420 if (useForegroundColor)
444 QRect scrollBarArea =
_scrollBar->isVisible() ?
448 QRegion contentsRegion = QRegion(rect).subtracted(scrollBarArea);
449 QRect contentsRect = contentsRegion.boundingRect();
451 painter.fillRect(contentsRect, backgroundColor);
452 painter.fillRect(scrollBarArea,
_scrollBar->palette().window());
457 const QColor& foregroundColor,
459 bool& invertCharacterColor)
461 QRect cursorRect = rect;
469 painter.setPen(foregroundColor);
476 int penWidth = qMax(1,painter.pen().width());
478 painter.drawRect(cursorRect.adjusted(penWidth/2,
480 - penWidth/2 - penWidth%2,
481 - penWidth/2 - penWidth%2));
490 invertCharacterColor =
true;
495 painter.drawLine(cursorRect.left(),
498 cursorRect.bottom());
500 painter.drawLine(cursorRect.left(),
503 cursorRect.bottom());
512 bool invertCharacterColor)
522 QFont font = painter.font();
523 if ( font.bold() != useBold
524 || font.underline() != useUnderline )
526 font.setBold(useBold);
527 font.setUnderline(useUnderline);
528 painter.setFont(font);
534 QPen pen = painter.pen();
535 if ( pen.color() != color )
538 painter.setPen(color);
546 painter.drawText(rect,0,
text);
561 if ( backgroundColor != palette().window().color() )
566 bool invertCharacterColor =
false;
569 drawCursor(painter,rect,foregroundColor,backgroundColor,invertCharacterColor);
583 void TerminalDisplay::setCursorPos(
const int curx,
const int cury)
585 QPoint tL = contentsRect().topLeft();
590 ypos = _topMargin + tLy + _fontHeight*(cury-1) + _fontAscent;
591 xpos = _leftMargin + tLx + _fontWidth*curx;
625 QRect region = screenWindowRegion;
626 region.setBottom( qMin(region.bottom(),this->_lines-2) );
631 || (region.top() +
abs(
lines)) >= region.bottom()
632 || this->_lines <= region.height() )
641 int linesToMove = region.height() -
abs(
lines);
642 int bytesToMove = linesToMove *
646 Q_ASSERT( linesToMove > 0 );
647 Q_ASSERT( bytesToMove > 0 );
653 Q_ASSERT( (
char*)lastCharPos + bytesToMove <
659 memmove( firstCharPos , lastCharPos , bytesToMove );
670 Q_ASSERT( (
char*)firstCharPos + bytesToMove <
674 memmove( lastCharPos , firstCharPos , bytesToMove );
680 scrollRect = QRect( topPoint ,
698 rect.setBottom(hotSpot->
endLine());
725 update( preUpdateHotSpots | postUpdateHotSpots );
750 Q_ASSERT( this->_usedLines <= this->
_lines );
751 Q_ASSERT( this->_usedColumns <= this->
_columns );
755 QPoint tL = contentsRect().topLeft();
765 const int linesToUpdate = qMin(this->_lines, qMax(0,
lines ));
766 const int columnsToUpdate = qMin(this->_columns,qMax(0,
columns));
768 QChar *disstrU =
new QChar[columnsToUpdate];
769 char *dirtyMask =
new char[columnsToUpdate+2];
775 int dirtyLineCount = 0;
777 for (y = 0; y < linesToUpdate; y++)
782 bool updateLine =
false;
787 memset(dirtyMask, 0, columnsToUpdate+2);
789 for(
x = 0 ;
x < columnsToUpdate ;
x++)
791 if ( newLine[
x] != currentLine[
x] )
798 for (
x = 0;
x < columnsToUpdate;
x++)
812 bool doubleWidth = (
x+1 == columnsToUpdate) ?
false : (newLine[
x+1].character == 0);
816 int lln = columnsToUpdate -
x;
824 bool nextIsDoubleWidth = (
x+
len+1 == columnsToUpdate) ?
false : (newLine[
x+
len+1].character == 0);
830 nextIsDoubleWidth != doubleWidth )
836 QString unistr(disstrU, p);
870 dirtyRegion |= dirtyRect;
875 memcpy((
void*)currentLine,(
const void*)newLine,columnsToUpdate*
sizeof(
Character));
925 _resizeWidget->setStyleSheet(
"background-color:palette(window);border-style:solid;border-width:1px;border-color:palette(dark)");
932 QString sizeStr = QString(
"Size: %1 x %2").arg(
_columns).arg(
_lines);
968 #if defined (HAVE_QREGION_ITERATORS)
969 for (QRect rect : (pe->region() & contentsRect()))
971 foreach (QRect rect, (pe->region() & contentsRect()).rects())
993 QWidget::focusInEvent(focusEvent);
1004 QWidget::focusOutEvent(focusEvent);
1019 if ( preeditLength == 0 )
1035 bool invertColors =
false;
1041 drawCursor(painter,rect,foreground,background,invertColors);
1058 QPoint cursorPos = mapFromGlobal(QCursor::pos());
1070 QListIterator<Filter::HotSpot*> iter(spots);
1071 while (iter.hasNext())
1077 int startColumn = 0;
1083 while ( QChar(
_image[
loc(endColumn,
line)].character).isSpace() && endColumn > 0 )
1112 QFontMetrics metrics(font());
1116 int baseline =
r.bottom() + 1;
1118 int underlinePos = baseline + metrics.underlinePos();
1120 if (
r.contains (mapFromGlobal(QCursor::pos())))
1123 painter.setPen (QColor (255,0,0));
1124 painter.drawLine (
r.left(), underlinePos,
1125 r.right() + 2, underlinePos);
1133 painter.fillRect(
r,QBrush(QColor(255,0,0,120)));
1143 QPoint topLeft = contentsRect().topLeft();
1145 int topLeftY = topLeft.y();
1159 QChar *disstrU =
new QChar[bufferSize];
1160 for (
int y = leftUpperY; y <= rightLowerY; y++)
1166 for (;
x <= rightLowerX;
x++)
1175 ushort extendedCharLength = 0;
1178 for (
int index = 0 ; index < extendedCharLength ; index++ )
1180 Q_ASSERT( p < bufferSize );
1181 disstrU[p++] = chars[index];
1190 Q_ASSERT( p < bufferSize );
1200 while (
x+
len <= rightLowerX &&
1201 _image[
loc(
x+
len,y)].foregroundColor == currentForeground &&
1202 _image[
loc(
x+
len,y)].backgroundColor == currentBackground &&
1219 QString unistr(disstrU,p);
1244 QTransform inverted = paint.transform().inverted();
1245 textArea.moveCenter( inverted.map(textArea.center()) );
1258 paint.resetTransform();
1292 result.setWidth(
_fontWidth * imageArea.width() );
1293 result.setHeight(
_fontHeight * imageArea.height() );
1327 parentWidget()->adjustSize();
1328 parentWidget()->setFixedSize(parentWidget()->
sizeHint());
1370 #if defined (SIGWINCH)
1466 if ( !contentsRect().contains(ev->pos()) )
return;
1473 QPoint pos = QPoint(charColumn,charLine);
1475 if ( ev->button() == Qt::LeftButton)
1483 if (actions.length ())
1484 actions.at (0)->activate (QAction::Trigger);
1493 bool selected =
false;
1501 if ((!
_ctrlDrag || ev->modifiers() & Qt::ControlModifier) && selected ) {
1510 _preserveLineBreaks = !( ( ev->modifiers() & Qt::ControlModifier ) && !(ev->modifiers() & Qt::AltModifier) );
1511 _columnSelectionMode = (ev->modifiers() & Qt::AltModifier) && (ev->modifiers() & Qt::ControlModifier);
1513 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1529 else if ( ev->button() == Qt::MidButton )
1536 else if ( ev->button() == Qt::RightButton )
1538 if (
_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
1541 ev->modifiers() & (Qt::ShiftModifier|Qt::ControlModifier),
1549 QWidget::mousePressEvent (ev);
1554 int charLine, charColumn;
1577 setCursor (Qt::PointingHandCursor);
1587 const QString& tooltip = spot->
tooltip();
1588 if ( !tooltip.isEmpty() )
1604 if (ev->buttons() == Qt::NoButton )
return;
1609 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1612 if (ev->buttons() & Qt::LeftButton)
1614 if (ev->buttons() & Qt::MidButton)
1616 if (ev->buttons() & Qt::RightButton)
1655 if (ev->buttons() & Qt::MidButton)
return;
1661 void TerminalDisplay::setSelectionEnd()
1663 extendSelection( _configureRequestPoint );
1668 QPoint pos = position;
1674 QPoint tL = contentsRect().topLeft();
1708 QPoint here = QPoint(charColumn, charLine);
1714 bool swapping =
false;
1721 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1722 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1723 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1724 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1725 swapping = left_not_right != old_left_not_right;
1728 QPoint
left = left_not_right ? here : _iPntSelCorr;
1745 QPoint right = left_not_right ? _iPntSelCorr : here;
1746 i =
loc(right.x(), right.y());
1762 if (left_not_right) {
1774 bool above_not_below = (here.y() < _iPntSelCorr.y());
1776 QPoint above = above_not_below ? here : _iPntSelCorr;
1777 QPoint below = above_not_below ? _iPntSelCorr : here;
1790 if (above_not_below) {
1798 QPoint newSelBegin = QPoint(ohere.x(), ohere.y());
1810 bool left_not_right = (here.y() < _iPntSelCorr.y() ||
1811 (here.y() == _iPntSelCorr.y() && here.x() < _iPntSelCorr.x()));
1812 bool old_left_not_right = (_pntSelCorr.y() < _iPntSelCorr.y() ||
1813 (_pntSelCorr.y() == _iPntSelCorr.y() && _pntSelCorr.x() < _iPntSelCorr.x()));
1814 swapping = left_not_right != old_left_not_right;
1817 QPoint
left = left_not_right ? here : _iPntSelCorr;
1820 QPoint right = left_not_right ? _iPntSelCorr : here;
1822 i =
loc(right.x(), right.y());
1825 if (selClass ==
' ') {
1832 right = left_not_right ? _iPntSelCorr : here;
1841 if (left_not_right) {
1852 if ((here == _pntSelCorr) && (scroll ==
_scrollBar->value())) {
1856 if (here == ohere) {
1860 if (
_actSel < 2 || swapping) {
1862 _screenWindow->setSelectionStart(ohere.x(), ohere.y(),
true);
1864 _screenWindow->setSelectionStart(ohere.x() - 1 - offset , ohere.y(),
false);
1876 _screenWindow->setSelectionEnd(here.x() + offset, here.y());
1889 if ( ev->button() == Qt::LeftButton)
1911 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1921 ((ev->button() == Qt::RightButton && !(ev->modifiers() & Qt::ShiftModifier))
1922 || ev->button() == Qt::MidButton) )
1930 QWidget::mouseReleaseEvent(ev);
1966 if ( ev->button() != Qt::LeftButton)
return;
1974 QPoint pos(charColumn,charLine);
1977 if (!
_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
1989 QPoint bgnSel = pos;
1990 QPoint endSel = pos;
1991 int i =
loc(bgnSel.x(),bgnSel.y());
2016 _screenWindow->setSelectionStart( bgnSel.x() , bgnSel.y() ,
false );
2019 i =
loc( endSel.x(), endSel.y() );
2037 if ( ( QChar(
_image[i].character ) ==
'@' ) && ( ( endSel.x() - bgnSel.x() ) > 0 ) )
2038 endSel.setX(
x - 1 );
2050 QTimer::singleShot(QApplication::doubleClickInterval(),
this,
2056 #if defined (HAVE_QWHEELEVENT_ANGLEDELTA)
2057 if (ev->angleDelta().y() == 0)
2060 if (ev->orientation() != Qt::Vertical)
2070 #if defined (HAVE_QWHEELEVENT_POSITION)
2071 QPoint pos = ev->position().toPoint();
2073 QPoint pos = ev->pos();
2077 #if defined (HAVE_QWHEELEVENT_ANGLEDELTA)
2078 int delta = ev->angleDelta().y();
2080 int delta = ev->delta();
2101 _iPntSel = QPoint(charColumn,charLine);
2161 return QWidget::focusNextPrevChild(
next );
2167 QChar qch=QChar(ch);
2168 if ( qch.isSpace() )
return ' ';
2170 if ( qch.isLetterOrNumber() ||
_wordCharacters.contains(qch, Qt::CaseInsensitive ) )
2185 setCursor(
_mouseMarks ? Qt::IBeamCursor : Qt::ArrowCursor );
2216 QString
text = QApplication::clipboard()->
text(useXselection ? QClipboard::Selection :
2217 QClipboard::Clipboard);
2220 if ( !
text.isEmpty() )
2222 text.replace(
"\n",
"\r");
2225 else if (
text.contains (
"\t"))
2227 qWarning (
"converting TAB to SPC in pasted text before processing");
2228 text.replace (
"\t",
" ");
2230 QKeyEvent e(QEvent::KeyPress, 0, Qt::NoModifier,
text);
2239 text.prepend(
"\033[200~");
2240 text.append(
"\033[201~");
2245 QApplication::clipboard()->setText(t, QClipboard::Selection);
2255 if (
text.isEmpty ())
2257 if (! extra_interrupt)
2261 QApplication::clipboard()->setText(
text);
2302 bool emitKeyPressSignal =
true;
2305 if ( event->modifiers() == Qt::ShiftModifier )
2309 if ( event->key() == Qt::Key_PageUp )
2314 else if ( event->key() == Qt::Key_PageDown )
2319 else if ( event->key() == Qt::Key_Up )
2324 else if ( event->key() == Qt::Key_Down )
2342 emitKeyPressSignal =
false;
2373 QKeyEvent keyEvent(QEvent::KeyPress,0,Qt::NoModifier,event->commitString());
2386 case Qt::ImMicroFocus:
2387 return imageToWidget(QRect(cursorPos.x(),cursorPos.y(),1,1));
2392 case Qt::ImCursorPosition:
2394 return cursorPos.x();
2396 case Qt::ImSurroundingText:
2400 QTextStream stream(&lineText);
2402 decoder.
begin(&stream);
2408 case Qt::ImCurrentSelection:
2453 _scrollBar->resize(QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent),
2454 contentsRect().height());
2518 if ( newSize != size() )
2541 QWidget::setFixedSize(
_size);
2558 if (event->mimeData()->hasFormat(
"text/plain"))
2559 event->acceptProposedAction();
2568 if (event->mimeData ()->hasUrls ())
2570 foreach (QUrl url, event->mimeData ()->urls ())
2572 if(dropText.length () > 0)
2574 dropText += url.toLocalFile ();
2605 if(event->mimeData()->hasFormat(
"text/plain"))
2615 QMimeData *mimeData =
new QMimeData;
2616 mimeData->setText(QApplication::clipboard()->
text(QClipboard::Selection));
2633 "<a href=\"http://en.wikipedia.org/wiki/XON\">suspended</a>"
2634 " by pressing Ctrl+S."
2635 " Press <b>Ctrl+Q</b> to resume.</qt>"),
2640 palette.setColor(QPalette::Normal, QPalette::WindowText, QColor(Qt::white));
2641 palette.setColor(QPalette::Normal, QPalette::Window, QColor(Qt::black));
2652 Qt::LinksAccessibleByKeyboard);
2657 _gridLayout->addItem(
new QSpacerItem(0,0,QSizePolicy::Expanding,
2658 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)
void set_global_shortcuts_signal(bool)
Emitted when focus changes.
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)
text(const graphics_handle &mh, const graphics_handle &p)
int string_width(const QString &txt)
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f
int qt_fontmetrics_horizontal_advance(const QFontMetrics &fm, QChar ch)
T::size_type strlen(const typename T::value_type *str)